-
Notifications
You must be signed in to change notification settings - Fork 715
[css-text-decor] Please implement text-strikethrough-position
key
#9027
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
Comments
I wonder why |
See issues filed with browsers below, which may or may not be able to addressed without this CSS key: |
If the main idea is to get UAs to use font information, well, they should just do it! The spec encourages that explicitly, e.g. https://www.w3.org/TR/css-text-decor-4/#line-auto-offset The only problem I'm concerned about here is if the fonts contain bogus information. If we're unable to detect those cases and they end up creating widespread problems, then we might need an explicit opt-in. So I think the right thing to do is file issues against the UAs, as you've done here, and if they push back and say they can't do it without an opt-in switch, then we can revisit and do something about that. |
Good points @fantasai . It looks like the Mozilla team is able to do on-the-fly testing for bogus values. If browsers can see whether a strikethrough is outside of the font bounds, maybe they can just (default to honoring the font but) choose their own hard-coded value if so. |
cc @drott |
Repeating @drott's question from the bug report ... Is there an opentype field for strike-through position? |
In submitting bug reports to various browsers, and how they are inaccurately rendering
from-font
values for text decoration (with this test page by @nicksherman), it started to become clear, that within the dichotomy of underline and strikethroughs (the two linear decorations that font files contain metadata for), there seems to be no way to invoke the font metadata which covers the strikethrough’s y-position.On the CSS level, how we invoke the values from the font:
✅ Underline thickness: Taken care of by text-decoration-thickness: from-font;
✅ Strikethrough thickness: Also taken care of by text-decoration-thickness: from-font;
✅ Underline position: Taken care of by text-underline-position: from-font;
❌ Strikethrough position
On the font level, these are the values in the font:
Underline: post table
Strikethrough: OS2 table
Suggestion:
text-strikethrough-position
key, for which there is a possible (and hopefully default)from-font
value.OS2
>yStrikeoutPosition
, and interpret it as the y-position of the top of the stroke.Thanks for your consideration!
The text was updated successfully, but these errors were encountered: