<p dir="ltr">I reached some interesting ideas about this tonight.  Will write up soon.</p>
<div class="gmail_quote">On Jan 3, 2014 8:25 PM, "Jonathan Kew" <<a href="mailto:jfkthame@googlemail.com">jfkthame@googlemail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 3/1/14 11:57, Khaled Hosny wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Jan 03, 2014 at 10:07:50AM +0000, Jonathan Kew wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 3/1/14 06:12, James Clark wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, Dec 30, 2013 at 7:26 PM, Jonathan Kew <<a href="mailto:jfkthame@googlemail.com" target="_blank">jfkthame@googlemail.com</a><br>
<mailto:<a href="mailto:jfkthame@googlemail.com" target="_blank">jfkthame@googlemail.<u></u>com</a>>> wrote:<br>
<br>
<br>
    There's overlap here with the process of font-matching (choosing the<br>
    font(s) to be used for a given text sequence), which is clearly out<br>
    of scope for harfbuzz. If a given Unicode character is not supported<br>
    (exactly, or via a *canonical* [de]composition) by a given font,<br>
    there are several possible outcomes: just render the font's .notdef<br>
    glyph; render some synthetic representation of the codepoint<br>
    (hexbox); render a compatibility-equivalent character/sequence, if<br>
    such exists; choose a different font.<br>
<br>
<br>
I agree with this model.  There's a general problem of what you might<br>
call "fallback": what to do if the requested font does not have a glyph<br>
for the requested character.<br>
<br>
This makes me realize that I don't understand the big picture of how<br>
this fallback process interacts with harfbuzz. In order to do fallback,<br>
you need to do character to glyph mapping.<br>
</blockquote>
<br>
Not necessarily. You need to know the character repertoire supported by the<br>
font, but you may not need to actually map to glyphs. In Firefox, for<br>
instance, font fallback is done based on a per-font *bit* map of supported<br>
Unicode codepoints. So at the font fallback stage, we know whether the<br>
character is present, but do not map it to a glyph.<br>
</blockquote>
<br>
One issue with that approach is you lose HarfBuzz’s ability to do<br>
Unicode composition/decomposition for unsupported characters, which<br>
should generally produce better resulting than font fallback. I wounder<br>
HarfBuzz can provide an API to help clients decide whether HarfBuzz can<br>
shape a given character with a given font or not? Or would that be too<br>
slow for practical use?<br>
</blockquote>
<br>
This is an interesting point, and one that we're still thinking about. Behdad has talked at some point about possibly having such an API, but we've never finalized anything.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In LibreOffice we just pass the characters to HarfBuzz, and if returns a<br>
0 glyph id for any character, font fallback is used for that one (some<br>
times with some of the surrounding characters to make sure clusters are<br>
rendered with the same font).<br>
</blockquote>
<br>
Yes, that's another possibility, though it wouldn't fit very readily into the current Gecko text architecture. It may well be a more natural approach for some other clients, though.<br>
<br>
JK<br>
<br>
______________________________<u></u>_________________<br>
HarfBuzz mailing list<br>
<a href="mailto:HarfBuzz@lists.freedesktop.org" target="_blank">HarfBuzz@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/harfbuzz" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/harfbuzz</a><br>
</blockquote></div>