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-3] initial-letter sizing for non-western scripts #5366

Open
faceless2 opened this issue Jul 27, 2020 · 1 comment
Open

[css-inline-3] initial-letter sizing for non-western scripts #5366

faceless2 opened this issue Jul 27, 2020 · 1 comment
Labels
css-inline-3 Current Work

Comments

@faceless2
Copy link

faceless2 commented Jul 27, 2020

This is a slightly different scope to #5244

The sizing algorithm defined for the size of the initial-letter is as follows:

Font size of drop cap = ((N-1) * line-height + [cap-height of para] * [font size of paragraph])/[cap-height ratio of drop initial font]

That seems to be working well for Latin and Indic and Hebrew scripts (which is why I'm supporting the "hebrew top" baseline disappearing and from the algorithm to be replaced by cap-height, as suggested in #5208).

However it's not working so well for ideographic scripts, at least in horizontal alignment.

image

The algorithm that is working for me is:

Font size of drop cap = ((N-1) * line-height + [ideographic-face-bottom of para - ideographic-face-top of para] * [font size of paragraph])/[ideographic-face-bottom of drop initial font - ideographic-face-top of drop initial font]

Which gives the following results:

image

Looking ahead to #5244 eventually defining a "top" and "bottom" baseline for various other scripts, it might be worth changing the algorithm to not reference cap-height or ideograph-face baselines directly; the general form is

Font size of drop cap = ((N-1) * line-height + [abs(a - b)] * [font size of paragraph])/[abs(c - d)]

where:

  • a is bottom alignment point of paragraph, as set by initial-letter-align
  • b is top alignment point of paragraph, as set by initial-letter-align
  • c is bottom alignment point of initial-letter, as determined by its content in section just after example 11
  • d is top alignment point of initial-letter, as determined by its content in section just after example 11
@faceless2 faceless2 added the css-inline-3 Current Work label Jul 27, 2020
@yisibl
Copy link
Contributor

yisibl commented Nov 24, 2022

Yes, top alignment instead of overflow would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-inline-3 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants