Skip to content
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

Accents are not well positioned in STIX and the new web fonts #731

Closed
dpvc opened this issue Feb 6, 2014 · 6 comments
Closed

Accents are not well positioned in STIX and the new web fonts #731

dpvc opened this issue Feb 6, 2014 · 6 comments
Labels
Accepted Issue has been reproduced by MathJax team

Comments

@dpvc
Copy link
Member

dpvc commented Feb 6, 2014

Accents from \hat, \grave, \dot, etc, are not centered properly for italic characters in the STIX and most of the new web fonts. There may need to be a flag in the fontdata file that indicates that italic shifting is needed (the TeX fonts have this built in).

@dpvc dpvc added this to the Bugfix Version milestone Feb 6, 2014
@dpvc
Copy link
Member Author

dpvc commented Feb 10, 2014

The TeX fonts include character-by-character "skew" data for adjusting the accent positions. MathJax uses this to improve the placements for the TeX fonts, but doesn't have this for STIX or any of the new web fonts. There is a heuristic that uses a stand-in for italic correction to adjust the positions, and this works OK for STIX, but not the other fonts.

I think the true fix for this will require generating skew data for the other fonts. I don't think this can be automated, as it has to do with the actual shapes of the glyphs as well as their slant, so this probably has to be done by hand. The TeX skew data came from the tfm files (it is part of the kerning information), and some of the new fonts are for use with TeX, so there must be tfm files for those, but the connection of OTF fonts to TeX tfm files is complicated, and it may be hard to extract them. In any case, I don't think Asana has TeX tfm files, so some hand work may be needed. Fortunately, TeX only has data for the standard 26 letters in upper and lower case, and the Greek letters, so it would be possible to do this by hand. But it is mind-numbingly tedious work.

I think it should wait until a future version. There are a number of other font-related issues that need to be addressed, as well, and I'm not sure these are priorities at the moment.

@pkra
Copy link
Contributor

pkra commented Feb 10, 2014

I think it should wait until a future version. There are a number of other font-related issues that need to be addressed, as well, and I'm not sure these are priorities at the moment.

+1

I'll reach out to the STIX group to see if they might be able to supply the skew data.

@davidmjones
Copy link

I may be repeating what you already know, but TeX just skews the
position of the accent by the amount of the kern pair between the base
character and a single arbitrarily chosen representative character
(the "skewchar") from the same font as the base character. Item 12 of
Appendix G of the TeXbook has the nasty details.

In other words, it's a bit of smoke and mirrors that relies on the
coincidence of there being a character in the font that happens to
have kern pairs that can do double duty in adjusting spacing of
accents.

For the STIX fonts, Khaled chose character 177 as the skewchar. In
most of the math fonts, that is U+2040 CHARACTER TIE. (The exception
is stix-mathrm, where that slot is occupied by U2019 RIGHT SINGLE
QUOTATION MARK. I assume that was deliberate, but I don't immediately
see why it was done that way.) This approach might not help with
Asana though -- I have no idea whether it has an appropriate magic
character.

N.b.: I use the words "arbitrarily" and "coincidence" advisedly, since
of course DEK had full control over the Computer Modern fonts and
their metrics, so he was in a position to load the dice.

@pkra
Copy link
Contributor

pkra commented Feb 10, 2014

Thanks for adding a comment, @davidmjones !

@dpvc
Copy link
Member Author

dpvc commented Feb 10, 2014

Thanks, David. Yes, I know that the skew information is stored in the kerning for the skew character. I haven't looked to see if I can get that information out of the STIX fonts (since the heuristics used in the absence of skew information work reasonably well with STIX).

In any case, since the STIX fonts are packaged in several forms, can you say which one you are referring to? Is it the STIX LaTeX version? (Or STIX Word, or STIX General?) To tell you the truth, I haven't looked at the LaTeX versions.

@dpvc dpvc removed this from the Bugfix Version milestone Mar 4, 2014
@pkra pkra added this to the A future font release milestone Aug 23, 2014
@dpvc dpvc removed this from the A future font release milestone Mar 10, 2022
@dpvc
Copy link
Member Author

dpvc commented Mar 10, 2022

Should be resolved in v3 font update.

@dpvc dpvc closed this as completed Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team
Projects
None yet
Development

No branches or pull requests

3 participants