[cairo] Cairo fails to render under Windows/MSVC

Jonathan Morton jonathan.morton at movial.com
Sun May 30 06:04:17 PDT 2010

On 29 May 2010 23:41, Tristam MacDonald <swiftcoder at gmail.com> wrote:
> I have a minimal sample using pango + cairo (attached), copied pretty
> much verabtim from a pangocairo tutorial on the web.
> This sample functions perfectly under Linux, writing out a png file
> containing a coloured and outlined rectangle, and a line of text.
> However, when compiled on Windows using MSVC, and linking against the
> pre-built cairo and pango binaries from GTK+, it only renders the
> background. You can double check this by changing the background color
> - this always renders out perfectly, but the fill, stroke and text
> never appear.
> Any ideas why this might be happening, given that the program compiles
> and runs without error, and does successfully render the background
> and output it as a png? I thought my Windows-specific hurdles were
> over when I managed to get it to compile, but apparently that is not
> the case...

I don't see any error checking in the code.  Adding some would help
you to narrow down the cause.  Cairo's standard behaviour when an
error is encountered is to ignore all drawing commands until the error
condition is rectified.

My gut feeling is this line:

    desc = pango_font_description_from_string("Arial Bold 12");

...simply because font handling *will* be different between platforms
to some extent.

 - Jonathan Morton

More information about the cairo mailing list