[cairo] Handling invalid glyphs

Behdad Esfahbod behdad at behdad.org
Tue Sep 11 12:46:48 PDT 2007


Hi,

Re bug 9846.  I want to commit the attached patch to cairo now, to get
it into a 1.4.12 soonish.  The issue at hand is real.  I've came across
many PDF files that fail to render any text because of this.

The patch is a bandaid, a really bad one.  The real fix is to:

  * for 1.4, fix all font backends to report 0x0 extents and render
nothing upon bad glyph indices and set no error at all.

  * for 1.6 propagate those errors up and return from the function call
made.

In the mean time, the patch works, but I'm not sure exactly why.  That
is, I don't know what the contents of face->glyph are set to after a
failing FT_Load_Glyph call.  I can probably do a proper fix, but didn't
feel like it just yet.  Maybe David knows what exactly happens and can
offer a better fix.

Objections?  Brian, do you want to fix the Quartz backend?  No idea
what's the status of win32.

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo-ft-font-invalid-glyph.patch
Type: text/x-patch
Size: 1510 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20070911/245e920a/attachment.bin 


More information about the cairo mailing list