Skip to content

[css-fonts-4] font kerning in vertical text #5295

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

Open
r12a opened this issue Jul 7, 2020 · 15 comments
Open

[css-fonts-4] font kerning in vertical text #5295

r12a opened this issue Jul 7, 2020 · 15 comments
Assignees
Labels
css-fonts-4 Current Work css-writing-modes-4 Current Work i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. Needs Example or Figure

Comments

@r12a
Copy link
Contributor

r12a commented Jul 7, 2020

6.3. Kerning: the font-kerning property
https://drafts.csswg.org/css-fonts-4/#font-kerning-prop

When kerning is enabled, the OpenType kern feature is enabled (for vertical text runs the vkrn feature is enabled instead).

I'm guessing that the vkrn feature is only applied to upright characters in a line of vertically-set text, whereas Latin text (say) that runs down the line on its side is not affected. Is this taken care of by the font only having vkrn settings for upright characters in vertical lines, or do we have an issue here?

@r12a r12a added the i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. label Jul 7, 2020
@svgeesus
Copy link
Contributor

svgeesus commented Jul 8, 2020

On reflection this text (which was also in CSS Fonts 3) is too brief:

When kerning is enabled, the OpenType kern feature is enabled (for vertical text runs the vkrn feature is enabled instead).

how about

When kerning is enabled, the relevant OpenType kerning features are enabled (for upright,horizontally set characters and for rotated, vertically set characters, the kern feature; for upright, vertically set characters, the vkrn feature. ).

followed by three examples - one of horizontally set text, one of vertically set text with all characters upright, and one of vertically set text with some characters rotated. I'm imagining color-coded backgrounds behind each glyph, for kern and vkern. That would also show (which should be obvious, but still) that a change between upright and rotated breaks kerning.

@fantasai
Copy link
Collaborator

fantasai commented Jul 8, 2020

You probably want to hook into https://www.w3.org/TR/css-writing-modes-4/#vertical-font-features

So

When kerning is enabled, the relevant OpenType kerning features are enabled (for horizontal [=typographic modes=] and for [=sideways typesetting=] in vertical [=typographic modes=], the kern feature; for [=upright typesetting=] in [=vertical typographic modes=], the vkrn feature.

And then I should be sure to export those terms from Writing Modes. :)

@fantasai
Copy link
Collaborator

fantasai commented Jul 8, 2020

OK, exported. @svgeesus You might want to edit-in-place the resulting markup into the /TR versions of these specs? Then the cross-refs will work when you publish css-fonts-4 to /TR as well.

svgeesus added a commit that referenced this issue Jul 9, 2020
@svgeesus
Copy link
Contributor

svgeesus commented Jul 9, 2020

@fantasai I was going to suggest republishing Writing Modes 4, as it has been a year, but apparently there is only one change since then?

@svgeesus
Copy link
Contributor

svgeesus commented Jul 9, 2020

@r12a you can see the altered text now; could you confirm whether this solves the issue or whether more changes are needed.

@svgeesus
Copy link
Contributor

svgeesus commented Jul 9, 2020

@fantasai I am now confused; upright typesetting and sideways typesetting and typographic mode all work in the 2019 CR. In terms of generated markup, what did 6c54cd3 add?

@r12a
Copy link
Contributor Author

r12a commented Jul 9, 2020

@r12a you can see the altered text now; could you confirm whether this solves the issue or whether more changes are needed.

Better, yes, thanks. However, it occurred to me while reading that tate-chu-yoko text is also upright in vertical lines, but should used kern rather than vkrn. Do you think we need to clarify that?

@svgeesus
Copy link
Contributor

svgeesus commented Jul 9, 2020

Definitely, and that needs another example. What spec should we link to, to explain that one?

By the way this example is not rendering correctly for me in Firefox or Chrome on Windows 10. Have not tried Safari yet. The test results led me to expect this would work.

@litherum
Copy link
Contributor

litherum commented Jul 9, 2020

I wish the spec could have affordances for TrueType in addition to OpenType. Specifically calling out kern and vkrn is probably fine, but there are other font technologies which are relevant too.

@svgeesus
Copy link
Contributor

svgeesus commented Jul 9, 2020

It does mention TrueType kern tables in addition to the OpenType kern and vkrn features

@svgeesus
Copy link
Contributor

@fantasai I was going to suggest republishing Writing Modes 4, as it has been a year, but apparently there is only one change since then?

Ah, its that the changes is not up to date. The History shows 25 commits

@svgeesus
Copy link
Contributor

@r12a I'd like to work with you to get good examples of kerning (and non-kerning) in both horizontal, vertical, and horizontal-in-vertical text. One problem is that ideographic text typically doesn't use kerning.

https://www.w3.org/International/articles/vertical-text/ doesn't have examples of kerning in vertical contexts. Do you have examples from other articles, or do new examples need to be created and verified?

@r12a
Copy link
Contributor Author

r12a commented Nov 30, 2020

@svgeesus do you have Ken Lunde's book CJKV Information Processing. You may find pp. 360 – 365 useful?

@svgeesus
Copy link
Contributor

Yes, but in Boston :(

@myakura
Copy link
Contributor

myakura commented Dec 1, 2020

#5295 (comment)

By the way this example is not rendering correctly for me in Firefox or Chrome on Windows 10. Have not tried Safari yet. The test results led me to expect this would work.

The digits value is only implemented in Trident (under the name -ms-text-combine-horizontal). The one works across browsers is text-combine-upright: all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-fonts-4 Current Work css-writing-modes-4 Current Work i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. Needs Example or Figure
Projects
None yet
Development

No branches or pull requests

5 participants