3 ms·
Well, for starters, there's kerning [1], hinting [2] and subpixel rendering [3] so that your text stays legible, even at small sizes. Then, if you want to supp
by jonas21 7y ago
Well, for starters, there's kerning [1], hinting [2] and subpixel rendering [3] so that your text stays legible, even at small sizes.
Then, if you want to support a variety of languages, you need to handle diacritics, ligatures, contextual shaping, and bidirectional text [4]. A character's appearance can very based on what comes before and after it. Or the base character can change appearance depending on the diacritics that are added to it. Some languages have complex rules about how you combine things, for example Thai [5].
If you want to support Emoji (and of course you do), then there's things like skin tone modifiers [6] and the zero-width joiner [7] that lets you make all kinds of crazy combinations.
Modern text rendering is, for better or worse, very complex.
[1] https://en.wikipedia.org/wiki/Kerning https://en.wikipedia.org/wiki/Kerning
[2] https://en.wikipedia.org/wiki/Font_hinting https://en.wikipedia.org/wiki/Font_hinting
[3] https://en.wikipedia.org/wiki/Subpixel_rendering https://en.wikipedia.org/wiki/Subpixel_rendering
[4] http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=CmplxRndExamples http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&ite...
[5] https://www.unicode.org/L2/L2018/18216-thai-order.pdf https://www.unicode.org/L2/L2018/18216-thai-order.pdf
[6] http://www.unicode.org/reports/tr51/tr51-16.html#Emoji_Modifiers_Table http://www.unicode.org/reports/tr51/tr51-16.html#Emoji_Modif...
[7] http://www.unicode.org/reports/tr51/tr51-16.html#Emoji_ZWJ_Sequences http://www.unicode.org/reports/tr51/tr51-16.html#Emoji_ZWJ_S...