[cairo] Patch for cairo-win32-font.c, when GetTextMetrics fails

Adrian Johnson ajohnson at redneon.com
Fri Nov 13 02:58:44 PST 2015

On 10/11/15 01:48, Patrick Fritzsch wrote:
> Hello,
> attached is a patch for cairo-win32-font.c, which fixed an issue with a
> problematic font on windows I had during printing a pdf document on
> cairo (not using poppler).

I've committed the patch (with some white space fixes).

> When Cairo fails internally for any reason it set sets an error code
> inside the context – and all content later, which i want to output on
> this context isn’t processed anymore. In above case it works, that I
> ignore that error-setting and process the rest of the document.
> So how can I achieve, that when I left the erroneous state inside the
> context, that it works again? I miss something like a cairo_reset_error
> function.

It is not possible. It is assumed that win32 fonts used with the win32
font backend are valid fonts that work with windows. If you are using
embedded fonts you may be better off using the freetype font backend as
freetype is more tolerant of incomplete fonts.

More information about the cairo mailing list