Re: [css-houdini-drafts] [font-metrics-api] Clarify Canvas Glyph Drawing Use Case

> However, I think it is a very important use case to be able to measure advance/offset/bounds for a run without first putting it into the DOM (A).

I can't upvote this enough.  https://github.com/khan/KaTeX makes extensive use of font metrics in order to layout math on the web.  Unfortunately, we have to ship metrics for all of the characters we use which is a lot.

Also, one of the ways that KaTeX maintains its speed is by not measuring the DOM.  If we had to do this, we'd end up having multiple cycles of measuring and updating the DOM which although it might improve the quality of the layout a bit, it would negatively impact the speed of the rendering significantly.

One of the things we've struggled with has been handling non-latin languages.  There's a lot of languages and some of those languages have lots of characters.  Right now we support some of those languages by providing approximate metrics for glyphs, but that reduces the quality.  

Also, many users would look to be able to use different fonts such as STIX instead of Computer Modern.  It would be nice to be able to just change the `@font-face` definition in the CSS and not have to run some script to extract font metrics from those font files.

-- 
GitHub Notification of comment by kevinbarabash
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/135#issuecomment-388650307 using your GitHub account

Received on Sunday, 13 May 2018 19:31:19 UTC