W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2020

Re: [csswg-drafts] [css-inline-3] Initial-letters layout can be improved (#5015)

From: Mike Bremford via GitHub <sysbot+gh@w3.org>
Date: Thu, 28 May 2020 07:42:46 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-635172354-1590651765-sysbot+gh@w3.org>
Thanks for sticking through to the end! Your comments indicate I should have been clearer on a few things, so I'll touch on those and then stop banging on about this for a bit and let it percolate through.

1. Despite appearances I'm not necessarily suggesting any changes to the syntax. `initial-letters: 3 3` seems quite reasonable, and both yourself and @dauwhe have clearly considered how an author would convey their intentions. My intent is to improve the _mechanism_ of initial-letters alignment, not the syntax. If necessary it could be made a shortcut property to set both `baseline-shift` and a property to control the font-size, eg. `initial-letters-size`.

2. I agree that the "two alignment points" concept is an effective way to convey how the font-size is derived. But once the size is derived I'm not sure that concept needs to hang around for alignment. Subjectively, I find it easier to conceive of the letter aligning with the first line and shifting down, than aligning with where the the third line is probably going to be and possibly shifting up.

3. Regardless of now the mechanism is defined, I think an important first step is to loosen the definition of `initial-letters` so the second argument can be a number, not an integer. That will immediately fix some of the limitations shown above. @zed-vector has just commented while I was editing this, so I think it's necessary.

4. "_But under your model, raised caps (size values larger than the drop value) would not really work as expected either._". I'm not really sure what "expected" is here, so that's a difficult point for me to debate :-) Again, I'm not necessarily making an argument for a change to the syntax.

5. "_And central baseline alignment also doesn't work as expected._" - this is for vertical text? Yes, I'm pretty sure I agree - we haven't implemented vertical layout yet so I haven't been able to work up some examples. Again, with `initial-letters` used as a shortcut property to set `baseline-shift`, if changes to the algorithm need to be made for vertical layout it could be done here.

Thank you again for taking the time to go through this. I think what's defined now does works for alphabetic baselines, but it could be clearer. Presuming the second argument to `initial-letters` is changed from an integer to a number then the two approaches lead to identical results. If I've demonstrated that you can describe the process another way and that proves useful, I've achieved what I hoped to.

I don't think what's there now works for hanging baselines, and if I've convinced you of that then I look forward to being part of the discussion on how to improve it. We have a decent testbed now with both algorithms implemented, so can easily trial any ideas.

GitHub Notification of comment by faceless2
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5015#issuecomment-635172354 using your GitHub account
Received on Thursday, 28 May 2020 07:42:48 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:07 UTC