You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-inline] Sizing problem with initial-letter-wrap: grid #947
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.
The size of the exclusion area in the inline direction must be
(''1ic'' + 'letter-spacing') × m,
where m is the smallest integer for which
the exclusion area is equal or larger than
the advance measure of the initial letter.
@frivoal is the figure accurate? Does the exclusion area need to include the letterspacing shown, otherwise the next character would be off-grid?
Thanks! Yes, the figure and text look good good to me.
However, thinking about letter spacing gave me a follow up question. Should the exclusion area count towards the min content inline size? If the line is shorter than the exclusion area but long enough to fit the initial letter frame, should there be scrollable overflow? I suggest that the answer to both questions should be no. If it is yes, then we probably shrink the exclusion area by 1 letter spacing when it is the last thing on the line (but not when it is not). That seems fiddly and needlessly complicated.
OK, we updated the spec (just with slightly different wording than you suggested). Good catch on the formula. I think I agree with you on the min-content size, there shouldn't be anything special caused by the exclusion area change. Probably the margin box of the initial letter should always be considered as part of the content, just as with any inline or float.
Activity
frivoal commentedon Jan 17, 2017
Actually, even that is wrong. It should be
(1ic + letter-spacing) × n, otherwise we won't line up with the next line.dauwhe commentedon May 22, 2018
Proposed text (and a new figure 11):
@frivoal is the figure accurate? Does the exclusion area need to include the letterspacing shown, otherwise the next character would be off-grid?
frivoal commentedon May 23, 2018
Thanks! Yes, the figure and text look good good to me.
However, thinking about letter spacing gave me a follow up question. Should the exclusion area count towards the min content inline size? If the line is shorter than the exclusion area but long enough to fit the initial letter frame, should there be scrollable overflow? I suggest that the answer to both questions should be no. If it is yes, then we probably shrink the exclusion area by 1 letter spacing when it is the last thing on the line (but not when it is not). That seems fiddly and needlessly complicated.
[css-inline] update image of CJK initial per #947
[css-inline] update CJK exclusion area text per #947
fantasai commentedon May 24, 2018
OK, we updated the spec (just with slightly different wording than you suggested). Good catch on the formula. I think I agree with you on the min-content size, there shouldn't be anything special caused by the exclusion area change. Probably the margin box of the initial letter should always be considered as part of the content, just as with any inline or float.
fantasai commentedon May 24, 2018
@frivoal Closing out the issue, mind reviewing to make sure we got it right? :)
frivoal commentedon May 24, 2018
2171624 looks good. Are you tracking the intrinsic size question elsewhere, or should I file it?
dauwhe commentedon May 24, 2018
File away!