News for hackers. Stuff that matters.
Re:Libschrift: A lightweight TrueType font rendering library by outadoc on Tuesday April 21, 2020 @04:34AM (#22933112)
It's necessary for quite a lot of Latin scripts.
Re:Libschrift: A lightweight TrueType font rendering library by flohofwoe on Tuesday April 21, 2020 @06:08AM (#22933541)
At 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.
Re:Libschrift: A lightweight TrueType font rendering library by HelloNurse on Tuesday April 21, 2020 @06:48AM (#22933729)
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.
Re:Libschrift: A lightweight TrueType font rendering library by flohofwoe on Tuesday April 21, 2020 @07:33AM (#22933957)
No, 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.
Re:Libschrift: A lightweight TrueType font rendering library by echeese on Tuesday April 21, 2020 @08:00AM (#22934116)
Yeah that sounds like something like Harfbuzz could do.
Re:Libschrift: A lightweight TrueType font rendering library by mmm_grayons on Tuesday April 21, 2020 @09:13AM (#22934640)
True, though at that point, you've left the domain of "lightweight" far behind.
Re:Libschrift: A lightweight TrueType font rendering library by qa-tari on Tuesday April 21, 2020 @12:04PM (#22936181)
On 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 Þ.
Re:Libschrift: A lightweight TrueType font rendering library by raphlinus on Tuesday April 21, 2020 @12:14PM (#22936279)
Most 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.