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

[css-inline] The web de-facto requires nonnegative line gap metrics in fonts #5064

Closed
litherum opened this issue May 12, 2020 · 5 comments
Closed

Comments

@litherum
Copy link
Contributor

Firefox and Chrome both run web fonts through the OpenType Sanitizer, which rewrites the font file. One of the things it does is clamp line gap metrics so that they aren't negative.

WebKit got a compatibility bug about this, since WebKit wasn't doing the same clamping. I've committed a change in WebKit to align with the other browsers and perform the clamping.

Because now all the browsers agree, and it is de-facto required for the web, the CSS fonts spec should say so (somewhere).

@litherum litherum added the css-fonts-4 Current Work label May 12, 2020
@astearns
Copy link
Member

Is the line gap metric clamping the only thing this sanitizer does that you think is required for web compat?

Are these metrics allowed to be negative per the OpenType spec?

@litherum
Copy link
Contributor Author

Is the line gap metric clamping the only thing this sanitizer does that you think is required for web compat?

This is the only thing I'm aware of today. Perhaps we will discover more in the future.

Are these metrics allowed to be negative per the OpenType spec?

The spec says they are of signed type. It doesn't say anything about negative values. https://docs.microsoft.com/en-us/typography/opentype/spec/hhea and https://docs.microsoft.com/en-us/typography/opentype/spec/os2

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-fonts] The web de-facto requires nonnegative line gap metrics in fonts, and agreed to the following:

  • RESOLVED: Fonts with negative line gaps are clamp at 0
The full IRC log of that discussion <dael> Topic: [css-fonts] The web de-facto requires nonnegative line gap metrics in fonts
<dael> github: https://github.com//issues/5064
<dael> myles: Pretty straightforward. Browsers do it but not in spec.
<dael> myles: If font says it has negative line-gap it's clampped at 0
<dael> Rossen_: Anyone with different opinion why this shouldn't be the case?
<dael> Rossen_: Obj to Fonts with negative line gaps are clamp at 0
<dael> florian: Quesiton, have you checked this is true of print formatter?
<dael> myles: No, haven't checked. FF, Chrome, and WK do it
<dael> florian: Sounds like a good idea, wondering if done in print and how we deal with compat. Maybe just suggest they do it as well
<dael> Rossen_: This is why we have standards
<dael> RESOLVED: Fonts with negative line gaps are clamp at 0
<dael> myles: I think metric is within inline spec so I think this issue should be parented under that spec
<dael> Rossen_: Sure

@litherum litherum changed the title [css-fonts] The web de-facto requires nonnegative line gap metrics in fonts [css-inline] The web de-facto requires nonnegative line gap metrics in fonts Apr 28, 2021
@litherum
Copy link
Contributor Author

Oh, this probably also affects the grammar of line-gap-override in css-fonts

@litherum
Copy link
Contributor Author

Oh, this probably also affects the grammar of line-gap-override in css-fonts

Oh, looks like this was already done in 348ed35

@svgeesus svgeesus assigned svgeesus and unassigned svgeesus Jun 9, 2021
@svgeesus svgeesus added css-inline-4 and removed css-fonts-4 Current Work labels Jun 9, 2021
@fantasai fantasai added the css-inline-3 Current Work label Feb 3, 2022
@fantasai fantasai closed this as completed Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy