w3c / w3c/csswg-drafts

[css-inline-3] Alternative initial-letter-align based on glyph bounds

Open
#5,220 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Commenter Response Pending css-inline-3
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

Kindle has had a version of initial-letter implemented for several years, but the default alignment follows a behavior which doesn't seem possible with the initial-letter spec. Instead of using font-wide metrics for alignment, it measures the specific glyph bounds of the text under initial-letter. It then can align the lowest point of the glyph with the baseline of the body text.

The behavior can be viewed in our KindleCreate app (image below):

Screen Shot 2020-06-16 at 10 42 12 AM

You can see the initial-letter (or drop cap as it's called here) actually takes up the 3 lines that are specified by the author. While a similar implementation in Safari would take up 4 since the descender knocks out an extra line.

Screen Shot 2020-06-16 at 10 50 43 AM

I'm working on asking some of publisher contacts what the expected behavior would be when characters with descenders are used with initial-letter, but in the meantime wanted to get a feel for other people's thoughts here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the issue description and its screenshots, then compare the described KindleCreate behavior with the CSS initial-letter specification and Safari behavior. The open question is how initial-letter should align when glyph bounds, including descenders, differ from font-wide metrics; completion would require agreement on the intended behavior and a corresponding specification change.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.