Re: [csswg-drafts] [css-fonts] Font Sizing for Readability (#6709)

I've always wanted to be able to specify the size of x-heights and cap-heights in CSS without having to know a font's internal font metrics ahead of time. This desire has only become stronger now after being able to do something like that in newer versions of Adobe Illustrator (which also offers the "ICF box" as a font-sizing option for East Asian CJK typography). The new-ish `text-box-trim` and `text-box-edge` properties in CSS also open up a lot of related possibilities for precise typesetting.

As such, I've always longed for something like `x-height-size` and `cap-height-size` properties. But actually, @scottkellum’s proposal of specifying alternate non-`em` anchors for the `font-size` property would also be quite handy. Perhaps there's a more intuitive/self-descriptive name than `font-sizing` though? Maybe something like `font-size-anchor`? `font-size-basis`? Or adapt terminology from Adobe and call it `font-size-reference`?

Something like Scott's proposed property would be even more powerful if it could be more than just a numberless unit. For example, instead of `font-size-reference: ex`, why not also allow for `font-size-reference: 2ex`, `font-size-reference: 1.5cap` or `font-size-reference: 4ch`? You could get even more advanced by allowing for `calc()` values to factor in several internal font metrics together.

Either way, I don't think the idea of simple properties like `x-height-size` and more advanced `font-size-reference` properties are mutually exclusive, and could override each other the same way other related properties do.

-- 
GitHub Notification of comment by nicksherman
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6709#issuecomment-2067247042 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 19 April 2024 20:32:16 UTC