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-values] Relative length units for stroke widths #838

Open
Crissov opened this issue Dec 27, 2016 · 3 comments
Open

[css-values] Relative length units for stroke widths #838

Crissov opened this issue Dec 27, 2016 · 3 comments

Comments

@Crissov
Copy link
Contributor

Crissov commented Dec 27, 2016

As mentioned before in #459 and #239, I believe that it would be useful to have additional relative length units to refer to the nominal width or thickness of strokes in the glyphs of a font.

  • The base stroke thickness is the width of primary stems, usually straight vertical strokes.
    UAs may determine the base stroke width from the median width of a vertical stem in a lowercase glyph with ascender, e.g. h (1?, / in x?).
    In the cases where it is impossible or impractical to determine the base stroke thickness, a value of 0.0625em must be assumed. This is 1px for the common default font size of 16px.

  • The hair-line stroke thickness is the width of secondary stems, often straight horizontal or diagonal strokes. In some fonts, by design, it does not differ from the base stroke thickness.
    UAs may determine the hair-line stroke width from the median width of a horizontal bar in a lowercase glyph, e.g. e (7?, \ in x?).
    In the cases where it is impossible or impractical to determine the hair-line stroke thickness, a value of 1bs must be assumed.

The exact names, definitions and abbreviations are of course open to discussion. I used to favor bs and hs or ds and us, but the s standing in for stroke may be too reminiscent of the one in s ‘second’ and ms ‘millisecond’.

@fantasai fantasai changed the title [css-values][css-text-decor] Relative length units for stroke widths [css-values] Relative length units for stroke widths Dec 28, 2016
@fantasai fantasai added the css-values-4 Current Work label Dec 28, 2016
@tabatkins
Copy link
Member

Per usual, can you give actual use-cases for this? Pages where, if you had this unit, it would enable you to do something that you currently can't do, or can only do with great effort/hackery?

@Crissov
Copy link
Contributor Author

Crissov commented Jun 21, 2018

The use case from #459 and #239 is setting the position or thickness of underlines etc.

@Crissov
Copy link
Contributor Author

Crissov commented Feb 19, 2020

If that remained the only valid use case, though, and authors were expected to only ever use 1bs and 1hs, respective keywords would work just fine as well.

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

3 participants