-
Notifications
You must be signed in to change notification settings - Fork 756
Description
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, 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 #6160 (comment), @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.)