3 ms·
If by "preprocessing" the string you mean hoping that the input contains, say, "LATIN CAPITAL LETTER U WITH GRAVE" instead of U and "COMBINING GRAVE ACCENT", it
by HelloNurse 7y ago
If by "preprocessing" the string you mean hoping that the input contains, say, "LATIN CAPITAL LETTER U WITH GRAVE" instead of U and "COMBINING GRAVE ACCENT", it is an unacceptable luck-based strategy.
Moreover, in practice both alternatives would be implemented in very similar ways (understanding tables of how to adjust the accent for a given letter vs. understanding tables of how the accented letter is decomposed into two glyphs): it's a safe assumption that a "lightweight" library does neither.
- deleted 7y ago[deleted]
- flohofwoe 7y agoNo, I mean that this replacement of U and "COMBINING GRAVE ACCENT" with a single codepoint for "LATIN CAPITAL LETTER U WITH GRAVE" can happen in a separate step in a separate library before that modified string is passed on to the text rendering library. I'm not entirely sure whether this works for "style ligatures", but it definitely works for umlauts and similar characters in all European languages.
- echeese 7y agoYeah that sounds like something like Harfbuzz could do.
- mmm_grayons 7y agoTrue, though at that point, you've left the domain of "lightweight" far behind.