← Back to team overview

kicad-developers team mailing list archive

Re: Cairo printing

 

On 10/7/18 10:05 PM, Wayne Stambaugh wrote:
[snip]
> This makes me nervous.  The gdiplus library brings wxGraphicsContext
> into play on windows.  Something from wxGraphicsContext is being pulled
> into the kicad build which can be enabled by configuring builds with
> -DUSE_WX_GRAPHICS_CONTEXT=ON.  I would have thought with cairo being
> both the display and print context that gdiplus would not be required
> for linking kicad.

Hi Wayne, Jean-Pierre,

Thank you for testing the code. I have already followed Tom's suggestion
and added gdiplus to linked libraries in my branch.

I wanted to take advantage of wxWidgets as much as I could, so I was
forced to work with wxDC. Otherwise I would have to go much deeper and
deal directly with CUPS and GDI+ to invoke a printing dialog and
actually start printing.

The only reasonable way to make wxDC and Cairo compatible is via
wxGraphicsContext, as it uses Cairo underneath. Have a look at
cairo_print.cpp [1] to see ugly details, but it is the only place where
I refer to gdiplus. I have not enabled USE_WX_GRAPHICS_CONTEXT on
purpose, as it seems to affect legacy canvases which is not needed here.

Cheers,
Orson

1.
https://git.launchpad.net/~orsonmmz/kicad/tree/common/gal/cairo/cairo_print.cpp?h=cairo_printing#n70

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References