4 ms·
You can draw a whole span or div that is invisible with fonts in it and everything off screen measure it. Delete it or then show it or move it or whatever. But
by aldousd666 2y ago
You can draw a whole span or div that is invisible with fonts in it and everything off screen measure it. Delete it or then show it or move it or whatever. But I've done this before with JavaScript.
- mmis1000 2y agoThat don't work for font that have bounding box disconnected to visual. Like the article just mentioned. Thus you need canvas if you absolutely need to figure out how bad is the bounding box of given font. Because it's the only way to get pixels in js.