Re: [csswg-drafts] [css-fonts] Vertical text doesn't play nicely with font-style and font-stretch (#4044)

Here's a proposal: Make a layer of indirection between font facilities and CSS facilities.

As described above, the OpenType group feels that having two variation axes, one for width, and another for "vertical width", where the browser applies the relevant one, is a good fit. This has to work even for non-variable fonts, so fonts should probably be able to be annotated as "this font has a vertical width of 115%" in the same way a font can be annotated (today; this is existing behavior) as "this font has a horizontal width of 115%" I can work with OpenType to see if it's possible to provide these annotations.

The `@font-face` _descriptors_ for `font-stretch` and `font-style` can be extended to take vertical arguments. The new grammar for the `font-stretch` descriptor would change from something like

`font-stretch: 110% 120%` (for a variable font)

to

`font-stretch: vertical 110% 120%`. Alternatively, a font that supports both horizontal stretching and vertical stretching could say `font-stretch: 80% 90% vertical 110% 120%`.

The same approach would apply to `font-style`, too.

This way, a font font declare that it is horizontally stretched or vertically stretched. It supports ranges for variable fonts, too.

Also, the `font-style` and `font-stretch` _properties_ are not modified. The browser already performs a layout before it knows which fonts to download (for `unicode-range`), so the browser can consider `writing-mode`, `text-combine`, etc. when determining which font to download. When content is written vertically, the browser will search for a font that has vertical width. When content is written horizontally, the browser will search for a font that has horizontal width.

Also, all common browsers support `font-style` synthesis. This would continue to work; we're allowed to synthesize horizontal oblique or vertical oblique, depending on use.

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

Received on Tuesday, 17 September 2019 04:21:15 UTC