Re: [Kicad-developers] Cairo printing
Just to let you know: I have just rebased and merged the Cairo printing support. Cheers, Orson On 10/7/18 1:53 PM, Maciej Sumiński wrote: > I have finished printing code refactor to take advantage of GAL in > pcbnew and gerbview [1]. This branch together with GALified > eeschema should cure GTK3-related headaches and lead us straight to 5.1. > In the meantime I will also try to port eeschema to the > new printing system for the sake of completeness, though it is not > critical for 5.1. > > I have tested the code on Linux x86_64, Windows 7 x86_64 and macOS > 10.13.4, but additional testing is welcome. > > Cheers, > Orson > > 1. https://code.launchpad.net/~orsonmmz/kicad/+git/kicad/+ref/cairo_printing > > ___ > Mailing list: https://launchpad.net/~kicad-developers > Post to : kicad-developers@lists.launchpad.net > Unsubscribe : https://launchpad.net/~kicad-developers > More help : https://help.launchpad.net/ListHelp > signature.asc Description: OpenPGP digital signature ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
Le 09/10/2018 à 12:46, Maciej Sumiński a écrit : > Hi Jean-Pierre, > > On 10/9/18 12:04 PM, jp charras wrote: > [snip] >> Hi Orson, >> >> The transparency issue (specific to Cairo render) is a minor issue (see >> attached picture, especially the oval pad) on screen, but could be more >> annoying on printed documents. > > Agreed, colors in printouts need to be opaque. I think the problem of > different colors in overlapping areas could be solved, but Cairo > documentation [1] says translucent colors are not supported on > PostScript surfaces and will result in rasterized images. It is bizarre > that I am not seeing this problem on Linux. On Windows, I am guessing the pdf printer (like CutePDF) uses a postscript based driver. On Windows, postscript drivers + wxWidgets printing have a problem: the lines like tracks (and oval pads) are draw as very thin lines, and CutePDF has this problem. On Linux, the pdf printer output is not rasterized. If the PS printer output is rasterized, this is hard to see, because (at least on my install) the zoom level does not really allow to see pixelization on the screen. By the way, with the Cairo printing, the PS output (and the PDF output) does not exhibit any longer this problem and is fine (as long there are no transparency). > > I have already patched my branch to use opaque colors for printouts. > >> I forgot an other issue: bitmaps (added with the page layout editor) are >> incorrectly scaled (something like 10 times smaller) in the print preview. > > Thank you for the report, I will check it. > > Cheers, > Orson > > 1. https://www.cairographics.org/documentation/using_the_postscript_surface/ > -- Jean-Pierre CHARRAS ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
Hi Jean-Pierre, On 10/9/18 12:04 PM, jp charras wrote: [snip] > Hi Orson, > > The transparency issue (specific to Cairo render) is a minor issue (see > attached picture, especially the oval pad) on screen, but could be more > annoying on printed documents. Agreed, colors in printouts need to be opaque. I think the problem of different colors in overlapping areas could be solved, but Cairo documentation [1] says translucent colors are not supported on PostScript surfaces and will result in rasterized images. It is bizarre that I am not seeing this problem on Linux. I have already patched my branch to use opaque colors for printouts. > I forgot an other issue: bitmaps (added with the page layout editor) are > incorrectly scaled (something like 10 times smaller) in the print preview. Thank you for the report, I will check it. Cheers, Orson 1. https://www.cairographics.org/documentation/using_the_postscript_surface/ signature.asc Description: OpenPGP digital signature ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
Le 08/10/2018 à 15:56, Maciej Sumiński a écrit : > Hi Jean-Pierre, > > On 10/8/18 3:08 PM, jp charras wrote: > [snip] >> Hi Orson, >> Very good job. >> >> I tested the Cairo printing both on Windows and Linux. >> >> No problem on Linux. >> On Windows, I have strange artifacts (see attached picture) in print >> preview. >> (more strange, if a zone outline includes the full board items, there >> are no, or very few, artifacts) > > I will check it, but I am afraid it might be beyond my control. Do you > see it in actual printouts/PDFs as well? > >> It happens only when the opacity of any printed item is not set to 1.0 >> >> Moreover, when the opacity of any printed item is not set to 1.0, the >> resulting printed picture is a bitmap (tested both using Cutepdf and a >> printer using a postscript driver), not really usable. >> (When all objects use a 1.0 opacity, the drawings are vectored, as expected) >> >> Due to the fact transparency is not working very well on Cairo, and >> useless when printing a board with one sheet by layer, I suggest to >> force the opacity to 1.0 in any case. > > That is surprising, I will need a closer look then. I would like to > preserve transparency, but I agree that getting bitmaps instead of > vector graphics is not acceptable. > > Regards, > Orson > Hi Orson, The transparency issue (specific to Cairo render) is a minor issue (see attached picture, especially the oval pad) on screen, but could be more annoying on printed documents. I forgot an other issue: bitmaps (added with the page layout editor) are incorrectly scaled (something like 10 times smaller) in the print preview. -- Jean-Pierre CHARRAS ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
Le 08/10/2018 à 15:56, Maciej Sumiński a écrit : > Hi Jean-Pierre, > > On 10/8/18 3:08 PM, jp charras wrote: > [snip] >> Hi Orson, >> Very good job. >> >> I tested the Cairo printing both on Windows and Linux. >> >> No problem on Linux. >> On Windows, I have strange artifacts (see attached picture) in print >> preview. >> (more strange, if a zone outline includes the full board items, there >> are no, or very few, artifacts) > > I will check it, but I am afraid it might be beyond my control. Do you > see it in actual printouts/PDFs as well? No. These artifacts are only in print preview, and only when some item uses a opacity < 1.0 > >> It happens only when the opacity of any printed item is not set to 1.0 >> >> Moreover, when the opacity of any printed item is not set to 1.0, the >> resulting printed picture is a bitmap (tested both using Cutepdf and a >> printer using a postscript driver), not really usable. >> (When all objects use a 1.0 opacity, the drawings are vectored, as expected) >> >> Due to the fact transparency is not working very well on Cairo, and >> useless when printing a board with one sheet by layer, I suggest to >> force the opacity to 1.0 in any case. > > That is surprising, I will need a closer look then. I would like to > preserve transparency, but I agree that getting bitmaps instead of > vector graphics is not acceptable. Transparency is useful only when printing many layers on the same sheet. It is not very good when printing one layer by sheet. > > Regards, > Orson -- Jean-Pierre CHARRAS ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
On Montag, 8. Oktober 2018 15:52:22 CEST Maciej Sumiński wrote: > Hi Zoltan, > > Good catch, I have just fixed the problem in cairo_printing branch. Fix confirmed, thx > Regards, > Orson > > On 10/8/18 10:49 AM, zgyarm...@zgyarmati.de wrote: > > Dear Maciej, > > > > i checked out and compiled your branch, it builds properly (Ubuntu 18.04, > > x86_64), but when i tested the print functionality, i noted that the > > marker > > for the zone fill perimeter is visible on the printed layout, see attached > > pdf (printed into file via the normal print dialog) and a screenshot of > > the fairly simple board. > > > > > > Regards > > Zoltan Gyarmati > > https://zgyarmati.de ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
Hi Simon, On 10/8/18 3:19 PM, Simon Richter wrote: > Hi, > > On 10/08/2018 08:59 AM, Maciej Sumiński wrote: > >> The only reasonable way to make wxDC and Cairo compatible is via >> wxGraphicsContext, as it uses Cairo underneath. > > wxDC also uses Cairo internally when wx is linked against GTK3. :P True, but I am trying solve a GTK version compatibility problem, not add one ;) > Windows binaries for the cairo_printing branch can be found at > > > http://downloads.kicad-pcb.org/windows/testing/patched/kicad-patched-142-3024ded91-x86_64.exe > > in case anyone wants to help testing. Many thanks, I really appreciate it! Cheers, Orson signature.asc Description: OpenPGP digital signature ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
Hi Jean-Pierre, On 10/8/18 3:08 PM, jp charras wrote: [snip] > Hi Orson, > Very good job. > > I tested the Cairo printing both on Windows and Linux. > > No problem on Linux. > On Windows, I have strange artifacts (see attached picture) in print > preview. > (more strange, if a zone outline includes the full board items, there > are no, or very few, artifacts) I will check it, but I am afraid it might be beyond my control. Do you see it in actual printouts/PDFs as well? > It happens only when the opacity of any printed item is not set to 1.0 > > Moreover, when the opacity of any printed item is not set to 1.0, the > resulting printed picture is a bitmap (tested both using Cutepdf and a > printer using a postscript driver), not really usable. > (When all objects use a 1.0 opacity, the drawings are vectored, as expected) > > Due to the fact transparency is not working very well on Cairo, and > useless when printing a board with one sheet by layer, I suggest to > force the opacity to 1.0 in any case. That is surprising, I will need a closer look then. I would like to preserve transparency, but I agree that getting bitmaps instead of vector graphics is not acceptable. Regards, Orson signature.asc Description: OpenPGP digital signature ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
Hi Zoltan, Good catch, I have just fixed the problem in cairo_printing branch. Regards, Orson On 10/8/18 10:49 AM, zgyarm...@zgyarmati.de wrote: > Dear Maciej, > > i checked out and compiled your branch, it builds properly (Ubuntu 18.04, > x86_64), but when i tested the print functionality, i noted that the marker > for the zone fill perimeter is visible on the printed layout, see attached > pdf > (printed into file via the normal print dialog) and a screenshot of the > fairly > simple board. > > > Regards > Zoltan Gyarmati > https://zgyarmati.de signature.asc Description: OpenPGP digital signature ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
Hi, On 10/08/2018 08:59 AM, Maciej Sumiński wrote: > The only reasonable way to make wxDC and Cairo compatible is via > wxGraphicsContext, as it uses Cairo underneath. wxDC also uses Cairo internally when wx is linked against GTK3. :P Windows binaries for the cairo_printing branch can be found at http://downloads.kicad-pcb.org/windows/testing/patched/kicad-patched-142-3024ded91-x86_64.exe in case anyone wants to help testing. Simon ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
Le 08/10/2018 à 08:59, Maciej Sumiński a écrit : > 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 Hi Orson, Very good job. I tested the Cairo printing both on Windows and Linux. No problem on Linux. On Windows, I have strange artifacts (see attached picture) in print preview. (more strange, if a zone outline includes the full board items, there are no, or very few, artifacts) It happens only when the opacity of any printed item is not set to 1.0 Moreover, when the opacity of any printed item is not set to 1.0, the resulting printed picture is a bitmap (tested both using Cutepdf and a printer using a postscript driver), not really usable. (When all objects use a 1.0 opacity, the drawings are vectored, as expected) Due to the fact transparency is not working very well on Cairo, and useless when printing a board with one sheet by layer, I suggest to force the opacity to 1.0 in any case. -- Jean-Pierre CHARRAS ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] 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 signature.asc Description: OpenPGP digital signature ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
On 07/10/18 22:05, Wayne Stambaugh wrote: > This makes me nervous. The gdiplus library brings wxGraphicsContext > into play on windows. Hi Wayne, IIRC this has nothing to do with wxGraphicsContext. It's cairo that uses gdiplus under windows as the printing backend. The only change needed is to include gdiplus in TARGET_LINK_LIBRARIES on Windows systems. Cheers, Tom ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
On 10/07/2018 02:45 PM, jp charras wrote: > Le 07/10/2018 à 19:25, Tomasz Wlostowski a écrit : >>> When building Kicad (on W7 32 bits), I have this link error: >>> > <...> >> >> Hi JP, >> >> I saw a similar problem, it can be fixed by adding gdiplus library to >> Windows link libraries in CMakeLists.txt >> >> Tom >> > > Yes, it works. > Thanks. > 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. ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
Le 07/10/2018 à 19:25, Tomasz Wlostowski a écrit : >> When building Kicad (on W7 32 bits), I have this link error: >> <...> > > Hi JP, > > I saw a similar problem, it can be fixed by adding gdiplus library to > Windows link libraries in CMakeLists.txt > > Tom > Yes, it works. Thanks. -- Jean-Pierre CHARRAS ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
On 07/10/18 18:21, jp charras wrote: > Le 07/10/2018 à 13:53, Maciej Sumiński a écrit : >> I have finished printing code refactor to take advantage of GAL in >> pcbnew and gerbview [1]. This branch together with GALified >> eeschema should cure GTK3-related headaches and lead us straight to 5.1. >> In the meantime I will also try to port eeschema to the >> new printing system for the sake of completeness, though it is not >> critical for 5.1. >> >> I have tested the code on Linux x86_64, Windows 7 x86_64 and macOS >> 10.13.4, but additional testing is welcome. >> >> Cheers, >> Orson >> >> 1. https://code.launchpad.net/~orsonmmz/kicad/+git/kicad/+ref/cairo_printing > > Hi Orson, > > When building Kicad (on W7 32 bits), I have this link error: > > ../common/libgal.a(cairo_print.cpp.obj): In function > `ZN7Gdiplus8Graphics6GetHDCEv': > C:/msys32_mywx/mingw32/i686-w64-mingw32/include/gdiplus/gdiplusgraphics.h:1070: > undefined reference to `GdipGetDC@8' > ../common/libgal.a(cairo_print.cpp.obj): In function > `ZN7Gdiplus8Graphics10ReleaseHDCEP5HDC__': > C:/msys32_mywx/mingw32/i686-w64-mingw32/include/gdiplus/gdiplusgraphics.h:1354: > undefined reference to `GdipReleaseDC@8' Hi JP, I saw a similar problem, it can be fixed by adding gdiplus library to Windows link libraries in CMakeLists.txt Tom ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
Re: [Kicad-developers] Cairo printing
Le 07/10/2018 à 13:53, Maciej Sumiński a écrit : > I have finished printing code refactor to take advantage of GAL in > pcbnew and gerbview [1]. This branch together with GALified > eeschema should cure GTK3-related headaches and lead us straight to 5.1. > In the meantime I will also try to port eeschema to the > new printing system for the sake of completeness, though it is not > critical for 5.1. > > I have tested the code on Linux x86_64, Windows 7 x86_64 and macOS > 10.13.4, but additional testing is welcome. > > Cheers, > Orson > > 1. https://code.launchpad.net/~orsonmmz/kicad/+git/kicad/+ref/cairo_printing Hi Orson, When building Kicad (on W7 32 bits), I have this link error: ../common/libgal.a(cairo_print.cpp.obj): In function `ZN7Gdiplus8Graphics6GetHDCEv': C:/msys32_mywx/mingw32/i686-w64-mingw32/include/gdiplus/gdiplusgraphics.h:1070: undefined reference to `GdipGetDC@8' ../common/libgal.a(cairo_print.cpp.obj): In function `ZN7Gdiplus8Graphics10ReleaseHDCEP5HDC__': C:/msys32_mywx/mingw32/i686-w64-mingw32/include/gdiplus/gdiplusgraphics.h:1354: undefined reference to `GdipReleaseDC@8' collect2.exe: error: ld returned 1 exit status gerbview/CMakeFiles/gerbview_kiface.dir/build.make:1612: recipe for target 'gerbview/_gerbview.kiface' failed make[3]: *** [gerbview/_gerbview.kiface] Error 1 CMakeFiles/Makefile2:1219: recipe for target 'gerbview/CMakeFiles/gerbview_kiface.dir/all' failed make[2]: *** [gerbview/CMakeFiles/gerbview_kiface.dir/all] Error 2 CMakeFiles/Makefile2:1191: recipe for target 'gerbview/CMakeFiles/gerbview.dir/rule' failed make[1]: *** [gerbview/CMakeFiles/gerbview.dir/rule] Error 2 Makefile:474: recipe for target 'gerbview' failed make: *** [gerbview] Error 2 -- Jean-Pierre CHARRAS ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp
[Kicad-developers] Cairo printing
I have finished printing code refactor to take advantage of GAL in pcbnew and gerbview [1]. This branch together with GALified eeschema should cure GTK3-related headaches and lead us straight to 5.1. In the meantime I will also try to port eeschema to the new printing system for the sake of completeness, though it is not critical for 5.1. I have tested the code on Linux x86_64, Windows 7 x86_64 and macOS 10.13.4, but additional testing is welcome. Cheers, Orson 1. https://code.launchpad.net/~orsonmmz/kicad/+git/kicad/+ref/cairo_printing ___ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp