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] text-align + initial-letter #5207

Closed
fantasai opened this issue Jun 13, 2020 · 5 comments
Closed

[css-inline-3] text-align + initial-letter #5207

fantasai opened this issue Jun 13, 2020 · 5 comments

Comments

@fantasai
Copy link
Collaborator

fantasai commented Jun 13, 2020

This is a follow-up to #884 (minutes).

We resolved that raised caps (sink=1) are treated as part of the text of the originating line for the purposes of alignment and justification. Then we tried to figure out what to do with sink > 1, and ended up anchoring the initial letter to the start edge while performing alignment in the remaining space.

I think this creates an unnecessary split in how raised caps and sunken caps interact with the rest of the content of the originating line. Both types of initial letters are affected by hanging-punctuation and text-indent, so having two models for implementing that behavior isn't great. Also a raised initial letter can still impact subsequent lines if it has a descender anyway, so we actually have to handle that problem in both cases regardless.

So I think we might want to consider a different solution: treat sunken initial letters the same as raised initial letters for the purpose of text alignment, and shorten the subsequent line boxes based on its resulting position in both cases. This way the positioning model of both types of initial letters is consistent, and we're handling subsequent impacted lines in both consistently in both cases as well.

@fantasai
Copy link
Collaborator Author

fantasai commented Jun 13, 2020

Note: There are still some differences in how raised vs sunken caps are handled, but they're at the typesetting level (affecting justification opportunities/letter-spacing/etc.) rather than the layout level.

@faceless2
Copy link

We thoroughly approve of this suggestion as it's what we're currently doing. Non-start alignment of initial-letter is weird anyway, but I think treating sink=1 differently to sink!=1 makes it even weirder. So I agree the "anchor to start edge and align in remaining space" approach should apply to all values of sink equally.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed text-align + initial-letter, and agreed to the following:

  • RESOLVED: make drop caps behave like raise caps for the purposes of text-align and justification
The full IRC log of that discussion <fantasai> Topic: text-align + initial-letter
<fantasai> github: https://wiki.csswg.org/planning/virtual-summer-2020#participants
<fantasai> github: https://github.com//issues/5207
<emilio> fantasai: we had a long discussion about this a while back and we decided for raise caps to make them part of the rest of the line
<emilio> ... but for drop caps we decided something else
<emilio> ... but having two models is not great, and even a raised initial can affect the second line if it has a descender
<emilio> ... so my proposal is to treat drop caps the same as raised caps, participating in the alignment context of the first line
<dbaron> It sounds like this might be better for shape-inside as well?
<emilio> ... then if it affects following lines it'd shorten them
<emilio> dbaron: What I've seen people do is combining initial-letter effects with shape-inside
<emilio> ... may or may not impact this discussion
<emilio> ... haven't worked through whether this decission affects it
<emilio> fantasai: I don't think it does
<dbaron> s/I've seen/I think I've seen/
<emilio> florian: as you pointed out raised cap with a descender already needs to deal with this so it makes sense to do the same
<emilio> RESOLVED: make drop caps behave like raise caps for the purposes of text-align and justification
@fantasai
Copy link
Collaborator Author

@dauwhe Mind reviewing the edits? :)

@dauwhe
Copy link
Contributor

dauwhe commented Aug 26, 2020

Edits look good.

@dauwhe dauwhe closed this as completed Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment