W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2021

[csswg-drafts] [css-fonts] Clarify/reconsider interaction of new font-size-adjust options with writing modes (#6288)

From: jfkthame via GitHub <sysbot+gh@w3.org>
Date: Thu, 13 May 2021 12:17:11 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-890991399-1620908230-sysbot+gh@w3.org>
jfkthame has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-fonts] Clarify/reconsider interaction of new font-size-adjust options with writing modes ==
In #6160, we agreed to extend `font-size-adjust` to accept a metric to use as the basis for adjustment, rather than always relying on the ex-height.

Supporting `ex` (the default/existing behavior) and `cap` seems straightforward enough; these would typically be values provided in the font's `OS/2` table.

However, `ch` is trickier, if we assume that it is intended to correspond to [the `ch` unit](https://drafts.csswg.org/css-values-4/#ch), because the Units & Values definition of `ch` requires that it depends on `writing-mode` and `text-orientation`. If the `ch` value for `font-size-adjust` is interpreted similarly, this implies that the same font, with the same `font-size` and `font-size-adjust` properties in effect, will be sized very differently in vertical-upright mode vs horizontal or vertical-sideways.

Consider a typical Latin font where the horizontal-mode `ch` unit may be, for example, 0.5em; however, the vertical-upright `ch` unit is typically more like 1em. If the author uses `font-size-adjust: ch 0.5`, intending to try and maintain a reasonably consistent width of text, then any content with `writing-mode: vertical-rl; text-orientation: upright` will get this font reduced to half of the computed font-size, because its vertical-upright `ch` of 1em will be scaled down to 0.5.

While it could be argued this is "expected" -- it's what the author asked for, maintaining a consistent advance for the characters -- I think it would in fact be surprising and undesirable. I believe the natural expectation of authors will be that for a given font, the combination of font-size and font-size-adjust will give a consistent result, not a radically different used size depending on the writing-mode orientation.

I propose, therefore, that we explicitly define that the `ch` value for `font-size-adjust` refers to *horizontal mode* character advance.

Given that this contrasts with the `ch` unit, perhaps sharing the keyword is in fact unhelpful, and we should expand the `font-size-adjust` value to `ch-width` for clarity.

To allow authors to explicitly request the equivalent adjustment for vertical-upright mode, we could add a vertical-advance version, perhaps called `vch`, or `ch-height` if we expand the horizontal one as suggested above.

I think all the same issues apply to `ic` as well as `ch`, and we should resolve that similarly, probably by explicitly splitting the value into `ic-width` and `ic-height`. (In many cases, horizontal and vertical advances may be the same, such that the issue is irrelevant, but that is not universally the case. And I think having `ic` and `ch` treated *differently* in this regard would be even more confusing.)

(I note that in https://github.com/w3c/csswg-drafts/issues/6160#issuecomment-814496106, @fantasai mentioned that `ic` would be writing-mode dependent, but on reflection I think this is an undesirable result, especially when considered in conjunction with `ch`, where the behavior that results from being writing-mode-dependent seems really jarring.)

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6288 using your GitHub account

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 13 May 2021 12:17:14 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:33 UTC