FitText dynamically sizes text to fit the container (UMD version)
npm install FitText-UMDjavascript
var fitText = require("FitText-UMD");
fitText( document.getElementById("responsive_headline") );
`
FitText-UMD may optionally be loaded globally in the HEAD, making it accessible via the window object.
See it in action
npm install
npm run example
Open http://localhost:8080 in the browser.
$3
The default setting works pretty well, but when it doesn't FitText has one setting you can adjust. If your text resizes poorly or is resizing all hurdy gurdy, you'll want to turn tweak up/down the compressor. It works a little like a guitar amp.
`javascript
fitText( document.getElementById("responsive_headline"), 1.2 ); // turn the compressor up (font will shrink a bit more aggressively)
fitText( document.getElementById("responsive_headline"), 0.8 ); // turn the compressor down (font will shrink less aggressively)
``