-
Notifications
You must be signed in to change notification settings - Fork 686
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-text] [css-values] Circular dependency between letter-spacing and x-height #5498
Comments
Note: Allowing |
The best solution is probably "don't run shaping when calculating the value of font-relative units." |
... and the |
Definitely. I would think "liga" is the least of your problems - |
cc @jfkthame |
The spec doesn't define exactly how to find the value of an 'ex' from the font, leaves that up to the UA with some pointers. So I don't think there's anything to fix here wrt the specs? https://www.w3.org/TR/css-values-3/#ex |
Right, we could arguably be more precise, but given the current lack of precision, no circular dependency seem mandated. |
@litherum Shall I close this no change, or is there some change to the spec you want to see here? |
Can we add a note? |
This patch adds |FontMetrics::IdeographicFullWidth|, which provides the value for the [`ic` unit]. The spec is not very clear as to how to compute the advance, but further discussion[1] clarified that it should not require shaping. This is confirmed to be in sync with the current Gecko and WebKit implementations. [`ic` unit]: https://drafts.csswg.org/css-values-4/#ic [1]: w3c/csswg-drafts#5498 (comment) Bug: 937101 Change-Id: Ia194c08bb93d84b6215b1c5aa49031c931182d59 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3711076 Reviewed-by: Dominik Röttsches <drott@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1017843}
…easured in absence of shaping. #5498
This patch adds |FontMetrics::IdeographicFullWidth|, which provides the value for the [`ic` unit]. The spec is not very clear as to how to compute the advance, but further discussion[1] clarified that it should not require shaping. This is confirmed to be in sync with the current Gecko and WebKit implementations. [`ic` unit]: https://drafts.csswg.org/css-values-4/#ic [1]: w3c/csswg-drafts#5498 (comment) Bug: 937101 Change-Id: Ia194c08bb93d84b6215b1c5aa49031c931182d59 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3711076 Reviewed-by: Dominik Röttsches <drott@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1017843} NOKEYCHECK=True GitOrigin-RevId: 1d6f40f434ed7bed90078583695d075f6010e754
https://drafts.csswg.org/css-text-3/#letter-spacing-property
letter-spacing
takes a<length>
, which means that it accepts font-relative units, like2ex
for example. Some (all?) browsers can measure theex
length by actually rendering a literal "x" character and inspecting its height (at least in the case where the metrics inside the font appear to be bogus). However, theliga
font feature can change which glyph the "x" character renders with, so if we're supposed to not apply optional ligatures, the height of the "x" character can change depending on whether we're disabling ligatures or not. This means that, if someone appliesletter-spacing
on an element withex
units, we may have to measure a glyph, but in order to know which glyph to measure, we have to know whether that glyph has a height of 0 or not.It's a weird fiddly corner case that probably wouldn't ever make a difference in real content, but it's probably worth at least considering how to fix it.
The text was updated successfully, but these errors were encountered: