Skip to content
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

[css-inline] Define how to synthesize ideographic-over and ideographic-under #10850

Open
kojiishi opened this issue Sep 7, 2024 · 3 comments

Comments

@kojiishi
Copy link
Contributor

kojiishi commented Sep 7, 2024

The text-box-edge property has text-edge as its value.

It defines that:

Which goes to these definitions:

  • ideographic-over: Corresponds to the line-over design edge of CJK (Han/Hangul/Kana) text. Assigned to idtp in OpenType.
  • ideographic-under: Corresponds to the line-under design edge of CJK (Han/Hangul/Kana) text. Assigned to ideo in OpenType.
  • ideographic-ink-over: Corresponds to the line-over ink edge of CJK (Han/Hangul/Kana) text. Assigned to icft in OpenType.
  • ideographic-ink-under: Corresponds to the line-under ink edge of CJK (Han/Hangul/Kana) text. Assigned icfb in OpenType.

Questions:

  1. Most fonts, including many CJK fonts, don't have these tables. How should this be synthesized when these are missing?
  2. When the first font in the cascade doesn't have these tables but the second one does, should UA synthesize from the first font, or use the table from the second font?

@fantasai @nt1m @vitorroriz @Clqsin45 @bfgeek @jfkthame @kidayasuo

@nt1m
Copy link
Member

nt1m commented Sep 7, 2024

cc @alanbaradlay who implemented this in WebKit. Maybe he can help answer?

@fantasai
Copy link
Collaborator

This is currently defined in https://www.w3.org/TR/css-inline-3/#baseline-synthesis ; though if it needs some improvement, we can improve it.

CC @MurakamiShinyu

@kojiishi
Copy link
Contributor Author

kojiishi commented Sep 13, 2024

This is currently defined in https://www.w3.org/TR/css-inline-3/#baseline-synthesis ; though if it needs some improvement, we can improve it.

Thank you for the pointer, I didn't know the section. I read it, but I'm not sure if I understand the algorithm in this section. Can you help?

  1. The central baseline is defined to be halfway between the ideographic-over and ideographic-under baselines, so any two of these determines the third.

and the central baseline:

Corresponds to the ideographic central baseline, halfway between the ideographic-under and ideographic-over baselines. Assigned to bsln value 1 in TrueType AAT.

Am I reading this correctly that this is defined from each other? I'm having difficulty to understand what it suggests when all of them are missing. If it means to fallback to the item 3:

  1. In CJK fonts the ascent and descent typically match the ideographic-over and ideographic-under baselines, so can be used as a fallback when both are missing.

Is this suggesting to use ascent/descent as the synthesized ideographic-over and ideographic-under? For text-box-trim, using ascent/descent means that it's the same as text. This Japanese article and another Japanese article indicates that using ascent/descent doesn't help for the vertical centering and alignment purposes for CJK fonts. For Meiryo, Hiragino, and Noto (Chrome/Firefox/Safari default Japanese fonts), ascent/descent don't match the desired position of ideographic-over and ideographic-under, and I'm failing to read what to do when ascent/descent don't match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants