Skip to content

[css-inline] Sizing problem with initial-letter-wrap: grid #947

Closed
@frivoal

Description

@frivoal

https://drafts.csswg.org/css-inline/#initial-letter-wrapping says:

The rule for matching the character grid is 1ch × n + letter-spacing × (n - 1), where n is the size of the initial letter as specified by the initial-letter property.

This seems wrong on two accounts:

  • This value is meant for CJK uses. The ic unit is the relevant one, not the ch unit. If we want to support aligning to a grid for latin monospaced fonts, we could make this depend on initial-letter-align, and use ic when it is set to ideographic and ch when it is set to alphabetic, but I am not sure it is worth doing, as Initial letters on monospaced latin text seems unusual.

  • n shouldn't be the size of the initial letter as specified by the initial-letter property. That would result in a too small exclusion area when the line gap is large (or when the initial-letter text is long).

Here's an example of initial-letter: 2 with a large line gap in vertical text. Each [ ] represents a 1ic square.

[ ]   ____|____
[ ]   ' _____ '
[ ]         /
[ ]        /
[ ]    ---+---
[ ]       |
[ ]       |
[ ]       ’
[ ]   [ ]   [ ]
[ ]   [ ]   [ ]
[ ]   [ ]   [ ]
[ ]   [ ]   [ ]

Here, the exclusion area needs to be 8ic + 7 × letter-spacing, not 2ic + 1 × letter-spacing.

I suggest replacing that sentence with something like this:

The size of the exclusion area in the inline direction must be 1ic × n + letter-spacing × (n - 1) where n is the smallest integer for which the exclusion area is equal or larger than the advance measure of the initial letter.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions