Hacker News new | ask | show | jobs
by gsnedders 2557 days ago
:first-letter doesn't actually suffice to make good initial letters, either as implemented or as spec'd.

The initial-letters CSS property (maybe to be renamed?) is the future solution to this, and that should work fine with search. See https://drafts.csswg.org/css-inline/#initial-letter-styling

1 comments

Can you say more what you mean by 'doesn't suffice'? There are certainly some forms of typographic initial I know it can't do. But if it worked consistently, it would be sufficient to achieve the effect that the article is attempting, wouldn't it?

Thanks for the link. I had no idea it was an active proposal.

Without knowledge of the fonts used, you can't get both ascender line and baseline aligned with respective lines of content, which is the traditional way of doing drop caps.

Sure, with web fonts and assumptions that the font always successfully loads and covers all graphemes in the text you can hardcode lengths to achieve proper alignment, but that's still a bit fragile.

The implementation in the article still used hard-coded lengths, perhaps this could have been fixed without the extra markup after all.