Skip to content

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

Closed

Description

@fantasai

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.

Activity

  1. fantasai commented on Jun 13, 2020

    @fantasai
    CollaboratorAuthor

    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.

  2. faceless2 commented on Jul 8, 2020

    @faceless2

    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.

  3. css-meeting-bot commented on Jul 28, 2020

    @css-meeting-bot
    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
  4. fantasai commented on Aug 13, 2020

    @fantasai
    CollaboratorAuthor

    @dauwhe Mind reviewing the edits? :)

  5. dauwhe commented on Aug 26, 2020

    @dauwhe
    Contributor

    Edits look good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions