Skip to content

avoid _render_type3_glyph() stopping subsequent rendering

When _render_type3_glyph() fails it returns CAIRO_STATUS_USER_FONT_ERROR causing the cairo surface to be set in error state and this is never cleared.

This prevents further rendering of subsequent content, while other PDF applications are able to handle this error condition more gracefully, omitting only the character or at most the font, with the remainder of the document showing up fine.

So let's do the same and change the returned error into a logging message but return success from _render_type3_glyph()

Also included is a fix for a pdftocairo bug: If a character isn't in /CharProcs at all, then pdftocairo displays it as the first /CharProcs entry (because CairoType3Font::create initializes the codeToGID array to 0). All other programs I tested will display it as a space or nothing.

Patch from Jeffrey Morlan

Fixes issue #1478

Merge request reports