4 ms·
I have a similar issue on the web. I have a library, which adds DOM elements and some text to the page. The library expects a certain font to be loaded on the
by SamBam 6y ago
I have a similar issue on the web.
I have a library, which adds DOM elements and some text to the page. The library expects a certain font to be loaded on the webpage. (This is an internal project, so is usually the case, but not always.) Obviously there are fall-back fonts if not, but those fallback fonts happen to be a different size given the same font-size specification, and so everything looks like crap.
The obvious solution would be to throw away the custom font. But if we really want to keep it, the only solution is to load the page, then measure the width of the text, then we know if the right font is loaded, and if it isn't then tweak the styles so things line up better.