[HarfBuzz] Font fallback strategies
Behdad Esfahbod
behdad at behdad.org
Thu Oct 25 12:44:42 PDT 2012
On 12-10-22 05:42 PM, Grigori Goronzy wrote:
> Hi,
>
> I'm currently investigating how to do better font fallbacks for my
> project. At the moment, fallback selection is nondeterministic (for a
> given codepoint) and doesn't make much effort to select a single font
> per same-script text run.
You need to tell us more about the context (system, etc) I think. You can use
Fontconfig.
Note that fallback order should be per-language, not per-script.
> Are there any general recommendations for fallback selection and
> splitting runs? The OpenType specification doesn't say anything about
> this (or I didn't look hard enough).
CSS recommends trying to choose fallback font for entire grapheme clusters at
a time, but I don't know any implementation that does that.
> Moreover, I wonder how to accurately determine what codepoints are
> supported by a given font. Is it safe to assume a codepoint or a
> sequences of codepoints as supported under all possible GSUB
> substitutions if they appear in the cmap?
Yes, cmap is what everyone uses essentially. Now, given the normalization
support in HarfBuzz, cmap would not be sufficient, but we have not added API
to HarfBuzz yet to help clients do better font selection.
behdad
> Best regards
> Grigori
More information about the HarfBuzz
mailing list