This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo pacman -S libmagick6 | |
PKG_CONFIG_PATH=/usr/lib/imagemagick6/pkgconfig gem install rmagick | |
# or with bundler: | |
PKG_CONFIG_PATH=/usr/lib/imagemagick6/pkgconfig bundle install |