-
Notifications
You must be signed in to change notification settings - Fork 707
[css-inline] need to define interaction of initial-letter and text-align other than start #884
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
Comments
we should make sure the spec produces sensible (?!?) results for the interaction of initial-letter with text-align values other than start
With `text-align: justify` and `text-align: justify-all`, clarifying that there is no justification opportunity between the initial letter and the adjacent text should be
enough.
For `end` and `center`, this is much more confusing, and it isn't clear there is an actual use case, so we should probably pick the simplest thing to implement.
We could leave the initial letter flush against the start edge anyway, which would be simple, and have the advantage of making sure that no subsequent line goes further towards the start than the initial letter, which may be desirable. This could however leave a large gap between the initial letter and the adjacent text in some cases. This seems especially bad in cases when `initial-letter-wrap` is set to `first` with the first line kerned into the initial letter area.
Moving the initial letter towards the end edge by the largest distance that does not cause overlap with the adjacent text would reduce this problem, but not eliminate it. I do not think it is worth the extra complexity.
One case where it could work without causing problems is if the `<integer>` value of the `initial-letter` declaration is `1`. I that case, There is no particular difficulty in respecting `center` or `end` alignments.
|
Should there be justification opportunity between the initial letter and the rest if one or both of them are CJK characters?
Or explicitly leave it unspecified? |
Should there be justification opportunity between the initial letter and the rest if one or both of them are CJK characters?
I don't think so. Especially if initial-letter-wrap is grid, I think it's pretty important that there isn't a justification opportunity. In the other cases, I am less sure, but I wouldn't want one either. You think there should be one?
> For end and center, this is much more confusing, and it isn't clear there is an actual use case, so we should probably pick the simplest thing to implement.
Or explicitly leave it unspecified?
That works too, I suppose.
|
I have no idea. Probably you're right that it is better no justification opportunity presents there. I think we generally want a flush alignment for all lines beside initial letter in CJK. If we need space there, it should be aligned to grid, rather than having justification opportunity. |
Agreed. That that can be done with |
OK, so the proposal is
|
The Working Group just discussed
The full IRC log of that discussion<TabAtkins> Topic: initial letter and text-align<dbaron> github: https://github.com//issues/884#issuecomment-392114382 <TabAtkins> fantasai: So how does initial-letter interact with text-align? <TabAtkins> fantasai: proposal is that for raised initials, no special behavior, it just aligns as specified. <TabAtkins> fantasai: sunk initials, suggestion is that initial-letter box's start margin edge is anchored to start edge of the line, then text-indent works on the rest of th etext on the line. It also suppresses justification between the initial-letter and subsequent text. <TabAtkins> fantasai: Say you have a bunch of chinese chars and inter-character spacing, you don't want spacing between initial-letter and first normal text letter on first line, but not on subsequent (because they're not "next" to the initial letter). <TabAtkins> fantasai: So instead they're flush on all lines. <TabAtkins> dbaron: I'm a little worried about the justification part. <TabAtkins> dbaron: Thinking about initial letters that are single-letter words, like english "A" or "I". Especially with wide justification, seems like it'll look weird. <TabAtkins> dbaron: The justification from word spaces seems different than inter-character. <TabAtkins> fantasai: justification opportunities *form the space* are different than justification arising from the letters. It'll still justify in that case. <TabAtkins> dbaron: Ah, that wasn't clear. Sounds good, but I want more clarity in that when it's written into the spec. <TabAtkins> fantasai: So three separate resolutions here. <florian> I looked into it, I like it. (all 3) <TabAtkins> fantasai: First, for raised initials, alignment is honored as usual. <TabAtkins> Rossen: Seems uncontroversial. <TabAtkins> dauwhe: It's just a big letter. <TabAtkins> RESOLVED: Raised initial is justified as normal. <TabAtkins> fantasai: Second is that sunk initials are attached to the start edge of the line, then alignment affects the rest of the line. <TabAtkins> [myles draws a picture] <TabAtkins> fantasai: We couldn't come up with anything better than that. <TabAtkins> florian: We couldn't find any use-cases, we just selected the simplest thing that wasn't horrible. <TabAtkins> dbaron: Do you ever actually see initial letters that aren't flush against the left edge? <dbaron> (where the left edge might be a shape rather than a straight edge) <TabAtkins> dauwhe: I've made some examples where you can set an explicit width on the ::first-letter and then right-align the initial-letter in that block, so the letters themselves aren't flush against the start edge. <TabAtkins> myles: What were the other options considered? <TabAtkins> dauwhe: Florian put some suggestions into the issue. <TabAtkins> florian: That was a long time ago... <tantek> the example dauwhe mentioned (I thought I heard) http://tantek.com/2015/224/b1/alphabet-indieweb <dauwhe> tantek: yes :) <TabAtkins> florian: One of my proposals was - do two steps. 1, do the "attached to start edge, then align rest of text", then 2 flush it with text as much as you can. <TabAtkins> florian: But that didn't seem good. <TabAtkins> myles: I could think of a few scenarios, but this is probably best. <TabAtkins> myles: A third is just lay out first line right-justified, place first letter, then try to place everything else. That sucks. <TabAtkins> myles: Fourth is make it not sunken, but it's probably more important to honor the sunken request. <TabAtkins> myles: Uncommon enough we can maybe consider it an error case. Probably not worth doing a two-pass for that. <TabAtkins> myles: So out of those four options, I think current proposal is best. <TabAtkins> fantasai: Another is lay out all the lines that are affected start-aligned, then apply alignment to all the lines at once. <TabAtkins> florian: I think that's what I suggested, the two-pass <TabAtkins> dbaron: I think it's slightly different. <TabAtkins> [fantasai draws out their suggestion] <TabAtkins> dbaron: That's different, but I think florian's is slightly better for right-alignment, while I think fantasai's is bad for right-alignment. Lines won't necessarily be flush. <TabAtkins> florian: Since we do consider this an error case, I agree we don't need to do either two-pass. <TabAtkins> myles: [question about diagram fantasai drew] <TabAtkins> myles: All of these suck. <TabAtkins> dbaron: You could constrain the later lines to be shorter than the first, but it's a lot of work... <TabAtkins> myles: I just think this is rare enough that it just won't really matter what we pick. <TabAtkins> fantasai: I also want to add a note to the spec that we don't expect this to be used, so if you actually need this to work a particular way, let us know. <TabAtkins> Rossen: This is the current behavior, too. <TabAtkins> Rossen: Objections? <fantasai> RESOLVED: For sunk initials, the initial letter box’s start margin edge is anchored to the start edge of the line (after first-line 'text-indent'), and alignment happens afterwards in the remaining space on the line. <TabAtkins> fantasai: Third part is initial-letter suppresses justification opportunities between the initial-letter and subsequent text. Specifically about between two characters, not about subsequent spacing, or stretchy characters. <TabAtkins> myles: Doesn't that fall out? <TabAtkins> fantasai: No, it's considered part of the first line's text. <TabAtkins> myles: So when you cneter the first line, that text will include the first letter, even tho we just resolved it won't be centered... <myles> So the first line's width is the full width, and justification/centering includes the width of the first letter, but the second line (when the first letter is sunken) has a shortened line-box, and the centering doesn't include the width of the first-letter inside the calculation <myles> ? <myles> fantasai: yes <TabAtkins> Rossen: Any objections? <tantek> really hoping to see someone try to implement such details <TabAtkins> RESOLVED: sunken initial letters suppress justification between the initial letter and subsequent text. |
Per @frivoal in today's face-to-face discussion, we should make sure the spec produces sensible (?!?) results for the interaction of
initial-letter
withtext-align
values other thanstart
The text was updated successfully, but these errors were encountered: