Re: [HarfBuzz] Selecting fonts for HarfBuzz
Dear Eli, > > HarfBuzz handles everything it understands. It was designed, in fact, such > > that when combined with > > FreeType or other external font funcs implementation, it even "handles" > > font formats it does not understand. > > Eg. HarfBuzz doesn't understand BDF, PCF, etc, but if you use hb-ft, you > > can use hb-ft for everything, and > > BDF, PCF etc also magically work because HarfBuzz defers to FreeType for > > glyph access, and simply > > "passes through" for the rest. It was designed such that you can keep one > > shaping code path. > > We don't currently use hb-ft on Windows. But thanks, I think I > understand. In case it is unclear, harfbuzz can quite happily handle any TTF or OTF whether or not it is designed to be shaped with OpenType or not. So you only need one code path and can simply pass any font to harfbuzz for shaping and harfbuzz will do the Right Thing (TM). Good news, I would suggest :) Yours, Martin ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz
Re: [HarfBuzz] Selecting fonts for HarfBuzz
> From: Behdad Esfahbod > Date: Wed, 5 Jun 2019 12:45:00 -0700 > Cc: "harfbuzz@lists.freedesktop.org" > > HarfBuzz handles everything it understands. It was designed, in fact, such > that when combined with > FreeType or other external font funcs implementation, it even "handles" font > formats it does not understand. > Eg. HarfBuzz doesn't understand BDF, PCF, etc, but if you use hb-ft, you can > use hb-ft for everything, and > BDF, PCF etc also magically work because HarfBuzz defers to FreeType for > glyph access, and simply > "passes through" for the rest. It was designed such that you can keep one > shaping code path. We don't currently use hb-ft on Windows. But thanks, I think I understand. ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz
Re: [HarfBuzz] Selecting fonts for HarfBuzz
On Wed, 05 Jun 2019 20:26:41 +0300 Eli Zaretskii wrote: > To make the question perhaps more concrete: the current code considers > a font to be a match for shaping with HarfBuzz if it's either OTF or > TTF, and covers at least one Unicode sub-range above u+00FF > codepoint. Is this a reasonable test, or should the code consider > additional font features? Even that's fraught. For example, my Tai Tham font Da Lekh includes some Thai characters because they're used with Tai Tham text, but doesn't include Thai script characters that aren't. I trust you're allowing for the fact that a font for an Indian script will typically use the dandas from the Devanagari block, without the font supporting anything else from the Devanagari block. Again, for a Tai Tham font: 1) Some good old faces may lack punctuation characters and logograms. This doesn't mean the fonts haven't been equipped with new, good GSUB and GPOS tables. 2) There seems to be an implication that Lao usage only uses one set of digits. 3) A Lao-based font would omit some consonants because they aren't used in the Lao tradition. 4) Some of the consonant marks are alien to modern Northern Thai habits, and may therefore be omitted from an old typeface. Some fonts omit explicit shaping for Tai Tham because they entirely reasonably want to avoid the USE. (Rumour has it that Andrew Glass wants to ban some words from being shaped properly.) They rely on the shaping being done by other features as applied to the default script. This doesn't work well on Windows, but could work well with HarfBuzz as the renderer. It's only a heuristic that they have a restricted repertoire - proper DIY Indic rearrangement is a pain, but even I can achieve it. Restricted repertoire would be very reasonable for a Myanmar script font - it's a more extreme version of the fact that Icelandic and German don't have the same set of letters. Richard. ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz
Re: [HarfBuzz] Selecting fonts for HarfBuzz
On Wed, Jun 5, 2019 at 12:36 PM Eli Zaretskii wrote: > > From: Behdad Esfahbod > > Date: Wed, 5 Jun 2019 12:07:36 -0700 > > Cc: "harfbuzz@lists.freedesktop.org" > > > > In other words, I don't know of a legitimate way to filter out broken > fonts like code2000. If that's what you are > > asking for. > > No, I wasn't asking about Code2000, I was asking a more general > question. > > > Let me ask it differently: why do you think you need to filter anything > out? > > I assumed that some fonts will not benefit from HarfBuzz, i.e. will > not support complex script shaping, because they lack some fundamental > features HarfBuzz needs. > > When Emacs needs to find a font for displaying a character which is > not supported by the default font, it scans the available fonts on the > system, looking for matching fonts. On Windows, we currently have 2 > matching criteria: one for fonts suitable for shaping with Uniscribe, > the other for all the rest (the latter generally don't support complex > script shaping). For HarfBuzz, the code currently employs the same > matching criteria as for Uniscribe (I described them roughly in a > previous message). I was asking whether HarfBuzz has additional > requirements from fonts, or would any font that's good for Uniscribe > will be good for HarfBuzz. > HarfBuzz handles everything it understands. It was designed, in fact, such that when combined with FreeType or other external font funcs implementation, it even "handles" font formats it does not understand. Eg. HarfBuzz doesn't understand BDF, PCF, etc, but if you use hb-ft, you can use hb-ft for everything, and BDF, PCF etc also magically work because HarfBuzz defers to FreeType for glyph access, and simply "passes through" for the rest. It was designed such that you can keep one shaping code path. -- behdad http://behdad.org/ ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz
Re: [HarfBuzz] Selecting fonts for HarfBuzz
> From: Behdad Esfahbod > Date: Wed, 5 Jun 2019 12:07:36 -0700 > Cc: "harfbuzz@lists.freedesktop.org" > > In other words, I don't know of a legitimate way to filter out broken fonts > like code2000. If that's what you are > asking for. No, I wasn't asking about Code2000, I was asking a more general question. > Let me ask it differently: why do you think you need to filter anything out? I assumed that some fonts will not benefit from HarfBuzz, i.e. will not support complex script shaping, because they lack some fundamental features HarfBuzz needs. When Emacs needs to find a font for displaying a character which is not supported by the default font, it scans the available fonts on the system, looking for matching fonts. On Windows, we currently have 2 matching criteria: one for fonts suitable for shaping with Uniscribe, the other for all the rest (the latter generally don't support complex script shaping). For HarfBuzz, the code currently employs the same matching criteria as for Uniscribe (I described them roughly in a previous message). I was asking whether HarfBuzz has additional requirements from fonts, or would any font that's good for Uniscribe will be good for HarfBuzz. ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz
Re: [HarfBuzz] Patches for building HarfBuzz with mingw.org's MinGW
> From: Behdad Esfahbod > Date: Tue, 4 Jun 2019 13:08:35 -0700 > Cc: "harfbuzz@lists.freedesktop.org" > > I can't say I'm super-excited about adding more workarounds, specially since > I don't even understand why you > can't use mingw64 instead. > > At any rate, I'm not one to judge. Please open a github Pull Request with > your changes and we'll go from > there. Done, I think. ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz
Re: [HarfBuzz] Selecting fonts for HarfBuzz
On Tue, Jun 4, 2019 at 8:01 PM Eli Zaretskii wrote: > > From: Behdad Esfahbod > > Date: Tue, 4 Jun 2019 12:05:00 -0700 > > Cc: "harfbuzz@lists.freedesktop.org" > > > > We assume fonts support shaping. Ie. we don't have a way to check for > font suitability for correct shaping. > > I understand, thanks. I wasn't asking how to do that with HarfBuzz, I > was asking what font features should my font matching function examine > to make sure the font will "support shaping" in the HarfBuzz sense. > Features that can be tested without actually shaping some text, of > course, i.e. without actually opening the font and using it. > And I was talking generally. There's nothing you can check in fonts that wouldn't leave some valid use-case out. In other words, I don't know of a legitimate way to filter out broken fonts like code2000. If that's what you are asking for. Let me ask it differently: why do you think you need to filter anything out? -- behdad http://behdad.org/ ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz
Re: [HarfBuzz] Selecting fonts for HarfBuzz
> Date: Wed, 05 Jun 2019 05:36:11 +0300 > From: Eli Zaretskii > Cc: harfbuzz@lists.freedesktop.org > > > We assume fonts support shaping. Ie. we don't have a way to check for font > > suitability for correct shaping. > > I understand, thanks. I wasn't asking how to do that with HarfBuzz, I > was asking what font features should my font matching function examine > to make sure the font will "support shaping" in the HarfBuzz sense. > Features that can be tested without actually shaping some text, of > course, i.e. without actually opening the font and using it. To make the question perhaps more concrete: the current code considers a font to be a match for shaping with HarfBuzz if it's either OTF or TTF, and covers at least one Unicode sub-range above u+00FF codepoint. Is this a reasonable test, or should the code consider additional font features? TIA ___ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz