Skip to content

Instantly share code, notes, and snippets.

View ver-1000000's full-sized avatar
😍
Love you!

佐々木 匠太 ver-1000000

😍
Love you!
View GitHub Profile
const optimalFontSize = (word, r, fontFamily, fontWeight) => {
const text = document.createElementNS('http://www.w3.org/2000/svg', 'text')
text.textContent = word
text.setAttributeNS(null, 'font-family', fontFamily)
text.setAttributeNS(null, 'font-weight', fontWeight)
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
svg.appendChild(text)
document.body.appendChild(svg)
let ok = 0
let ng = 100