[HarfBuzz] improving hb_ot_hide_default_ignorables

Behdad Esfahbod behdad at behdad.org
Fri Sep 27 11:14:33 PDT 2013


Thanks Jonathan.  Can you test my alternate approach?  Attached.

On 13-09-27 11:22 AM, Jonathan Kew wrote:
> Hi Behdad,
> 
> With the change in variation selector handling, stray (unsupported) VS codes
> are no longer consumed by the get_glyph callback; they remain in the buffer
> and are individually mapped to glyphs. That's all very well; but in most cases
> they'll just map to .notdef.
> 
> Eventually, hb_ot_hide_default_ignorables() will run across these .notdef
> glyphs and replace them with zero-width space glyphs. All's good...
> 
> ...except in the (unlikely) case where the font does not actually support the
> <space> character. This will be almost vanishingly rare, of course - but
> unfortunately it happens with the "MarkA" font that's used for a variety of
> rendering tests.
> 
> This prompted me to look into patching hb_ot_hide_default_ignorables() so that
> it will work even if there's no <space> in the font. ISTM we can fix this by
> simply deleting the ignorable altogether in this case. It'll be a bit less
> performant than the current replace-with-zero-width-space implementation,
> because it requires shifting all the following glyphs up in the buffer, so
> I've retained the existing implementation for the (usual) case where <space>
> is available.
> 
> Suggested patch is attached.
> 
> JK

-- 
behdad
http://behdad.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: default-ignorables-alternate.patch
Type: text/x-patch
Size: 1654 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20130927/676483ce/attachment.bin>


More information about the HarfBuzz mailing list