[cairo] Error handling in cairo_type1_font_subset_get_glyph_names_and_widths

Peter Weilbacher mozilla at weilbacher.org
Wed Nov 12 03:33:35 PST 2008


Hi Adrian,

On 02.11.2008 12:27, Adrian Johnson wrote:
> The second sentence "only get the widths for the glyphs that are 
> actually used" is what will fix your bug. The first sentence has more to 
> do with eliminating the FreeType dependency in type1-subset. If 
> _cairo_scaled_glyph_lookup() fails or returns the wrong metrics your 
> font will not display correctly on the screen at which point you would 
> want to replace the font.

OK.

> I've pushed out the simple fix - falling back to type1-fallback if it fails:
> 
> http://gitweb.freedesktop.org/?p=cairo;a=commit;h=6434cddb899d750b815d71f8f51ae3e4568dd3c0

Didn't have time to post about this before, but this was the workaround that
I had tried earlier, and actually it made matters worse. I haven't investigated
why, but if it encounters the problematic glyph I get a crash when I test this
in my original testcase with Firefox on OS/2, where before I got the error
message and a garbled PDF.
Just as a warning for now, that more is to come on this issue...

Luckily, the problem with this font was acknowledged and fixed in FreeType,
something I also still have to test.

   Peter.


More information about the cairo mailing list