Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Be careful with ligatures in Web pages. They have downsides, which might not initially be apparent.

Ligatures are their own font characters. That is, an s-t font ligature is not recognized as an s and a t except visually. So, some things break:

1) search of text. "step" become a font-dependent codepoint followed by "tep"

2) accessibility for handicapped users. Readers generally cannot correctly translate ligatures.

3) browsers do not guarantee to handle your ligature correctly, especially older versions of browsers.

So, for the small increment in esthetics, you're creating a small pile of annoyances for readers and affecting the ability to find docs on your site via search engines.

For these reasons, you don't frequently find ligatures in Web pages.



The trick is to use a font that has ligatures, but not to use the ligature characters directly. Let the presentation choose the glyphs to display, and let the encoded characters remain separate as they should. CSS handles this with "font-variant-ligatures" (works in some browsers). I just did a test in Chrome on OS X; toggling between "font-variant-ligatures: common-ligatures" and "font-variant-ligatures: none" changed the presentation, but it did not negatively impact the accessibility, searchability, etc. as the ligature characters would. Automatic glyph substitution in presentation yay; encoded character substitution nay.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: