Skip to content

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

@faceless2

Description

@faceless2

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions