4 ms·
It's necessary for quite a lot of Latin scripts.
by outadoc 6y ago
It's necessary for quite a lot of Latin scripts.
- flohofwoe 6y agoAt least umlauts also have their unique UNICODE code points and font glyphs, and AFAIK that's true for all European languages at least, and can be handled without special support down in the rendering engine as long as the input string has been "preprocessed" accordingly.
- HelloNurse 6y agoIf 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 6y ago[deleted]
- flohofwoe 6y 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 6y agoYeah that sounds like something like Harfbuzz could do.
- mmm_grayons 6y agoTrue, though at that point, you've left the domain of "lightweight" far behind.
- qa-tari 6y agoOn the contrary, this library currently cannot deal with a composed code point e.g. for “LATIN CAPITAL LETTER U WITH DIAERESIS” either, as TrueType fonts tend to only contain glyphs for the base letter and diacritical marks, but no combinations of them. This affects most accented characters from Latin-1, but not unique ones like ¶ or Þ.
- raphlinus 6y agoMost fonts will include some combinations (generally Latin-1), but not all that are encoded in Unicode. A proper shaping library such as Harfbuzz will navigate all possibilities, including composed and decomposed Unicode input, and fonts with both precomposed characters and separate glyphs for combining marks. Getting all this right would be highly challenging for a small, simple library, as it requires fine-grained knowledge of both Unicode and OpenType.