-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How is a character's height/depth retrieved? #828
Comments
Currently, there is no API for javascript to get the glyph metrics for a browser font (though there are some proposals for that). So MathJax has the needed data for the characters in its fonts stored in data files that it loads as part of the font data. That is one reason that MathJax only handles specific fonts (one right now, but more on the way later this summer). See the common/fonts files for the base information. The CHTML and SVG output jax add more information that is specific to that output format. The SVG output doesn't actually use fonts, but rather paths generated from the fonts, so svg/fonts adds all the path information into the font data. |
Thanks, that’s exactly what I was looking for. |
As a follow-up on that: what about the |
@paeifbnaeufbpae, that is a nice idea, but the values seem to be in CSS pixels, while MathJax needs sub-pixel accuracy in order to do the layout properly. Also, I suspect that |
Hm... I suspect that you could just artificially scale the text up by And given that you first need to call the I guess a quick experiment would answer this question. |
OK, an experiment does seem to show that they are the actual font metrics on a character-by-character basis, and that they use decimal parts of a pixel rather than full pixels. So that does seem useful, and worth looking into. |
Does WOFF provide native functionality to retrieve what corresponds to height/depth in the TeX box model, given a specific character? If not, how (and where in the source) are these calculated in MathJax? If I’m not mistaken they are necessary information for TeX's layout.
The text was updated successfully, but these errors were encountered: