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

Any reason why winAscent + winDescent can’t be smaller than the UPM? #1227

Closed
schriftgestalt opened this issue Sep 23, 2020 · 1 comment · Fixed by #1279
Closed

Any reason why winAscent + winDescent can’t be smaller than the UPM? #1227

schriftgestalt opened this issue Sep 23, 2020 · 1 comment · Fixed by #1279
Labels

Comments

@schriftgestalt
Copy link
Contributor

schriftgestalt commented Sep 23, 2020

intLeading = font->win.ascent + font->win.descent - font->unitsPerEm;
if (intLeading < 0) {
/* Avoid negative internal leading */
font->win.ascent -= intLeading;
intLeading = 0;
}

This might be a good check for auto calculated winAscent + winDescent values. But quite confusing for manually set values.

@frankrolf frankrolf changed the title Any reason why winAscent + winDescent can’t be smaller then the UPM? Any reason why winAscent + winDescent can’t be smaller than the UPM? Sep 23, 2020
@josh-hadley
Copy link
Collaborator

This code has been around for quite a while, probably with the same logic since the beginning. I don't think anyone is still around who was involved in the decisions on why it's done. I suspect it's rooted in the OT spec recommendations around metrics and BTBD or something along those lines.

I would be open to the idea of changing this to detect-and-warn, without modifying any values. That way, anyone who is reliant on this behavior (knowingly or not) would at least be notified and make modifications to modify the values, if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants