no printing from Windows
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GTK+ |
Fix Released
|
Critical
|
|||
Inkscape |
Fix Released
|
High
|
Rygle | ||
0.46.x |
Fix Released
|
Critical
|
Rygle | ||
Old |
Fix Released
|
High
|
Rygle |
Bug Description
Running Windows XP, and Inkscape0712311
When I use File|Print, I get no printout, and no crash.
In DOS I get a one line message :
C:\Python25\
cairo_win32_
P.S. this is a major improvement over Dec18 Windows build, which would crash on printout, and would not allow me to save anything as 'Plain SVG' or 'Compressed Plain SVG', both of these now work well, congratulations!
P.P.S. I believe the file \inkscape\
It leads to a duplicate entry under File|Save As ...|Compressed Inkscape SVG (*.svgz)
[Changing title to not be build-specific, since the problem persists in later builds... -Tom Davidson]
Changed in inkscape: | |
importance: | Undecided → Medium |
Peter Lewerin (vermeil-deactivatedaccount) wrote : | #1 |
Changed in inkscape: | |
status: | New → Confirmed |
Simon (simon2) wrote : | #2 |
Confirmed here too on Inkscape 0.45+devel+devel, built Jan 29 2008 under Windows XP. Only difference: Inkscape simply crashes after showing a message "Inkscape encountered an internal error and will close now."
This is independant of the printer.
Simon
Alvin Penner (apenner) wrote : | #3 |
Running Windows XP, Inkscape 0.46pre1-1win32.7z, Feb 1, 2008.
the error message is now somewhat enhanced :
C:\Python25\
(inkscape.exe:708): Gtk-CRITICAL **: gtk_file_
g_path_is_absolute (filename)' failed
** (inkscape.exe:708): WARNING **: Family name Sans does not have an entry in th
e font lister.
** (inkscape.exe:708): WARNING **: Family name Sans does not have an entry in th
e font lister.
cairo_win32_
Tom Davidson (tjd-mit) wrote : | #4 |
The 'Family name Sans does not have an entry in the font lister error' may be a red herring: it's due to the default font in your preferences.xml file being specified as 'Sans', when you don't have a font by that name installed on your system. Can you confirm that at least that warning goes away when you edit preferences.xml? (replace Sans with 'Arial' or something... Preferences.xml should also be updated if you open a document, create some text using an installed font, then close Inkscape normally...
Alvin Penner (apenner) wrote : | #5 |
yes, indeed.
I modified the font-family to be Arial, and created some normal text and saved it, and now when I attempt to print, the only message I get is the following:
C:\Python25\
(inkscape.exe:180): Gtk-CRITICAL **: gtk_file_
g_path_is_absolute (filename)' failed
cairo_win32_
thanks for the help !
description: | updated |
Tom Davidson (tjd-mit) wrote : | #6 |
Milestoning since seems to be a pretty big regression that has been confirmed by several users now... not sure who to assign to, though...
Changed in inkscape: | |
importance: | Medium → High |
milestone: | none → 0.46 |
do1eh (rnh) wrote : | #7 |
In 0.46pre I get no printout and no crash as decribed in the initial bug report
but if I render a "lorem ipsum"-Text or a barcode before printing Inkscape crashes.
do1eh (rnh) wrote : | #8 |
I'm sorry please forget what I wrote before:
Inkscape 0.45.1+
(As lorem ipsum and barcodes both contain text I didn't realize that is wasn't the pythonscripts but actually the text)
That never happened in previous versions (0.45.1, built Mar 21 2007)
Bryce Harrington (bryce) wrote : | #9 |
In order for this to remain milestoned, we must have an assignee for the bug, who will take ownership of getting it fixed.
We cannot block the release on platform-specific bugs that have no owner.
Duositex (duositex) wrote : | #10 |
I'm not positive but I believe this also may prevent other applications from printing properly once an attempt is made from Inkscape. I will attempt to provide evidence of this if it seems further to be the case.
One comment:
"We cannot block the release on platform-specific bugs that have no owner."
While I understand this attitude, having a bug of this nature in the 0.46 release on a non-obscure platform seems ill-advised, especially given that if it's possible to print from a previous version without this problem. Losing such a basic (from the user's perspective) feature could potentially be very frustrating. As someone who uses Inkscape for professional work and regularly espouses its virtues, I hope that fixing a seemingly trivial feature like this is considered a top priority by whoever has the ability to remedy the matter.
Thanks!
micool (flightsim) wrote : | #11 |
on win 2000, each attempt to print a file result to "Inkscape encountered an internal error and will close now"... so can't print from inkscape.
This bug, added to the Bug #178803, where the save as PDF via cairo can't be done without converting text to path is a real problem ( useless huge pdf files can be generated this way )
Duositex (duositex) wrote : | #12 |
In Windows XP I *can* save PDF via cairo but the text in the resultant PDF is upside-down. The rest of the PDF turns out fine. It only crashed once when I attempted this. I was going to make mention of that in my previous comment but I assumed a bug report for that existed already and it seemed off-topic. Thanks!
David Bower (dave-koales) wrote : | #13 |
I also confirm that it's not working for me on Windows XP with Inkscape-
I created a fairly simple page (two straight lines, two boxes, grouped, and then cloned to create 16 tiles in all, i.e. a label template!). When printed, all I got was a solid black square 2.5cm x 3.2cm in the bottom right corner of the page, suggesting that the page has also been rotated 180 degrees, as previously suggested).
I've tried printing to a physical printer and also to PDF Creator (just in case). Same output in both cases.
Also, I would agree with Duositex, releasing with this bug would not do the project any favours...!
Bryce Harrington (bryce) wrote : | #14 |
Obviously, it makes no sense to block a release indefinitely on an issue no one has committed to fix, else we would never release.
I will be dropping the milestone on this bug within a few days unless someone steps forward to take ownership of it. (I don't care if the owner lacks the technical skill to fix it, if they're at least willing to seek out and motivate someone who does to provide a patch.)
Keep in mind that the Windows version of Inkscape is actually just a port - one produced by the valiant efforts of a number of Windows users who wished to see it available on their platform. Our core focus has been Linux, and so for bugs that are specific just to Windows we are entirely dependent on Windows-based contributors to support it.
Note that even if you are not a technical person, there are still a LOT of open questions that a non-technical person could probably investigate. Does this issue affect all windows users, or only those using a specific printer driver? Or a specific windows version? Only one person has provided a backtrace; do others experiencing this issue also see the same backtrace, or something different? The backtrace provided looks like the user didn't install the debug symbols for Inkscape... if this is true, how does it look if these symbols are included? Most of the backtrace given seems to involve cairo and fontconfig - are the issues specific to fontconfig or cairo? If newer or older versions of each are used, would that resolve it? If so, then the fix could simply be a packaging issue, by including newer versions of these things.
Changed in inkscape: | |
milestone: | 0.46 → none |
Duositex (duositex) wrote : | #15 |
It would seem to me that the popularity of Inkscape as a cross-platform tool somewhat hinges on the ability for the software to be used uncrippled on Windows. My uneducated guess would be that a 0.46 release with an asterisk next to the Windows download that says, "This software crashes when you attempt to print." would not benefit the project. I would imagine that some Windows users would gladly trade some of the newer, more obscure features for basic functionality. Is it possible to add a bounty to this bug to get it squashed?
I understand if you feel as though you've been put on the defensive, but tone of your response could be interpreted as that of someone who is apparently putting the burden of solving the problem on the people that were kind enough to identify it. Perhaps I was mistaken when I assumed that our work with this software is analogous to beta-testing commercial software, and that my role ends and you pick up when I report the problem and state, with much hope and optimism, "This is going to be a fantastic piece of software when it's released, I just hope this one nagging issue is resolved."
Okko7 (okko7) wrote : | #16 |
I was actually looking forward to introduce Inkscape in our company as standard drawing programme. The ability to inmport would have made this possible, but of course, since my company is (unluckily) windows based, that would be impossible without printing.
Anyway, to answer Bryce's question: I've tried on two computers (both on Windows XP), three printers and two PDF conversion software (PDF Creator and XPPDF) and the same thing happend with all of them. So I don't think that this is linked to any printer driver. I'd be glad to provide, but I don't have an idea how to do this.
Simon
Kees Cook (kees) wrote : | #17 |
Without digging into it on Windows (I don't have any Windows machines), this sounds like a problem somewhere between Cairo and the GTK Printing subsystem. I slightly suspect this bug report contains 2 separate issues:
- no-crash no-print
- crash-on-print
The first backtrace shows a crash in fontconfig via cairo. The "no crash no print" issue is likely what is reporting the "cairo_
Tom Davidson (tjd-mit) wrote : | #18 |
I was wondering whether the difference between windows and linux behavior could be due to different cairo versions being used (Windows packages 1.5.8), so I upgraded my Fedora 8 system to the 1.5.8 release ( using the F9 packages at http://
ishmal (ishmalius) wrote : | #19 |
Just FYI, I was digging around, and found the "handle is invalid" message source. cairo-win32_
if (_cairo_
free (surface);
...and in _cairo_
gm = GetGraphicsMode (hdc);
if (gm == GM_ADVANCED) {
GetWorldTransform (hdc, &saved_xform);
ModifyWorldTra
}
clipBoxType = GetClipBox (hdc, &rect);
if (clipBoxType == ERROR) {
_cairo_
SetGraphicsMode (hdc, gm);
/* XXX: Can we make a more reasonable guess at the error cause here? */
return _cairo_error (CAIRO_
}
It's failing GetClipBox(). 'hdc' is the handle in question. They should also check 'gm' for ERROR. I bet
it's the same error.
ishmal (ishmalius) wrote : | #20 |
Tracing the problem a bit further: cairo_win32_
Bryce Harrington (bryce) wrote : | #21 |
Duositex, your assumption is correct - with non-commercial open source software like Inkscape, which is driven mainly(*) through volunteer efforts, there isn't that firm distinction of roles between users and developers - really there are just contributors and non-contributors. I blogged about this more at http://
What you're reading from my comment is not defensiveness (not intentionally anyway!) but literally that yes, the burden of supporting Windows needs to lay within the Windows community. Not necessarily the person who reported the issue, but maybe someone who otherwise would assume fixing it was "someone else's problem". Ideally, a Windows person with development experience would look into this and sort it out, but lacking such a person, even a non-developer can assist in making progress with the bug as I mentioned in my previous comment.
Anyway, I asked Kees to outline his thoughts on what needs to be done technically. I think this may just be a packaging issue, that can be sorted out within the Windows build, outside the core. But someone on Windows needs to do the leg work of figuring this all out.
Aaron C Spike (acspike) wrote : | #22 |
FYI, I recently had some difficulties with pycairo on win32. I built pycairo against our libs bundle (cairo 1.4 at the time iirc) as an easy out (all of the deps were collected there in one place for me). Things worked fine until I tried to use text. Every attempt to use text caused a crash. Recently I found an updated binary of cairo and pycairo 1.4 on the gtk site and with these versions I do not experience a crash. I would postulate from my experience that this crash if it is caused by text is not related to the version of cairo, but rather the build. I wonder if perhaps this is caused by some bad linking against or between the font librarys that cairo uses. (Those font libs always confuse me. seems like there are a number of cross deps that would be difficult to get right.)
Duositex (duositex) wrote : Re: [Bug 179988] Re: no printing from Windows | #23 |
I thank everyone for their quick efforts to solve this problem and to
Bryce for doing a good job fielding my questions and giving good
responses. Sincerely appreciated.
On Thu, Feb 21, 2008 at 8:43 PM, Aaron Spike <email address hidden> wrote:
> FYI, I recently had some difficulties with pycairo on win32. I built
> pycairo against our libs bundle (cairo 1.4 at the time iirc) as an easy
> out (all of the deps were collected there in one place for me). Things
> worked fine until I tried to use text. Every attempt to use text caused
> a crash. Recently I found an updated binary of cairo and pycairo 1.4 on
> the gtk site and with these versions I do not experience a crash. I
> would postulate from my experience that this crash if it is caused by
> text is not related to the version of cairo, but rather the build. I
> wonder if perhaps this is caused by some bad linking against or between
> the font librarys that cairo uses. (Those font libs always confuse me.
> seems like there are a number of cross deps that would be difficult to
> get right.)
>
>
>
> --
> no printing from Windows
> https:/
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Inkscape: A Vector Drawing Tool: Confirmed
>
> Bug description:
> Running Windows XP, and Inkscape0712311
> When I use File|Print, I get no printout, and no crash.
> In DOS I get a one line message :
> C:\Python25\
> cairo_win32_
>
> P.S. this is a major improvement over Dec18 Windows build, which would crash on printout, and would not allow me to save anything as 'Plain SVG' or 'Compressed Plain SVG', both of these now work well, congratulations!
>
> P.P.S. I believe the file \inkscape\
> It leads to a duplicate entry under File|Save As ...|Compressed Inkscape SVG (*.svgz)
>
> [Changing title to not be build-specific, since the problem persists in later builds... -Tom Davidson]
>
Adrian Johnson (ajohnson-redneon) wrote : | #24 |
> Tracing the problem a bit further: cairo_win32_
I don't recommend using cairo_win32_
cairo_win32_
cairo_win32_
ishmal (ishmalius) wrote : | #25 |
@Adrian:
I agree. I saw that file yesterday and asked about it. But cairo_win32_
ishmal (ishmalius) wrote : | #26 |
Well, after searching through Gtk code last night, with help from Mental, it LOOKS like Win32 API's PrintDlgExW() is returning ok, but that printdlgex->hDC is not being set. Thus the null argument to cairo_win32_
Here is the gtk source:
http://
Look at lines 1544 and 1603.
Anyway, we're strategically no closer to fixing the bug, but have made tactical advances. But it looks like the problem is definitely upstream in Gtk territory or MinGW or something like that. Maybe it's not the source, but just a particular build?
Bryce Harrington (bryce) wrote : | #27 |
ishmal, thanks for investigating this. Since it sounds like an issue in the dependencies, I take it this is something that can be worked out at the packaging level, so there's no reason for us to block the core inkscape release on it. A true fix will require involvement from upstream (does anyone have an upstream bug report url we could link this to?)
Perhaps for the 0.46 release, the windows build could ship with printing disabled - when the user clicks print, display a message explaining the issue and indicating they can print to pdf to print, or whatever is considered the best workaround, and when working upstream libs become available, a new windows package can be released with that.
ishmal (ishmalius) wrote : | #28 |
More info. gtk-demo.exe in the /devlibs dir -does- print, tho messy. This is with the same libs as inkscape.exe. Curious.
Adrian Johnson (ajohnson-redneon) wrote : | #29 |
The gtk+ bug is
http://
Changed in gtk: | |
status: | Unknown → New |
Duositex (duositex) wrote : | #30 |
I would be happy with this as long as text in PDF's is no longer
upside down on printing. Is this fixed? Thanks guys!
--Chris
On Fri, Feb 22, 2008 at 2:33 PM, Bryce Harrington
<email address hidden> wrote:
> ishmal, thanks for investigating this. Since it sounds like an issue in
> the dependencies, I take it this is something that can be worked out at
> the packaging level, so there's no reason for us to block the core
> inkscape release on it. A true fix will require involvement from
> upstream (does anyone have an upstream bug report url we could link this
> to?)
>
> Perhaps for the 0.46 release, the windows build could ship with printing
> disabled - when the user clicks print, display a message explaining the
> issue and indicating they can print to pdf to print, or whatever is
> considered the best workaround, and when working upstream libs become
> available, a new windows package can be released with that.
>
>
>
> --
> no printing from Windows
> https:/
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Inkscape: A Vector Drawing Tool: Confirmed
>
> Bug description:
> Running Windows XP, and Inkscape0712311
> When I use File|Print, I get no printout, and no crash.
> In DOS I get a one line message :
> C:\Python25\
> cairo_win32_
>
> P.S. this is a major improvement over Dec18 Windows build, which would crash on printout, and would not allow me to save anything as 'Plain SVG' or 'Compressed Plain SVG', both of these now work well, congratulations!
>
> P.P.S. I believe the file \inkscape\
> It leads to a duplicate entry under File|Save As ...|Compressed Inkscape SVG (*.svgz)
>
> [Changing title to not be build-specific, since the problem persists in later builds... -Tom Davidson]
>
jhoechtl (johann-hoechtl) wrote : | #31 |
This is Inkscape 0.45+0.
I can only confirm the aforementioned bug when printing on Windows PLUS:
Export to ps (using cario or builit-in) or to pdf is not working. svg or svgz works though.
Given this behaviour and the unwillingness to postpone the release to fix this severe issue
I would vote to remove Windows from the list of supported plattforms: Without this 'feature'
(print, huhu, cool) you can not call it supported.
Duositex (duositex) wrote : | #32 |
I would second this motion. Export to PDF now crashes on 0.45+0.46pre2 here as well (as downloaded from inkscape.org) and printing does nothing here. It's a shame but I would suggest that Windows be removed from the supported platforms list as well.
Okko7 (okko7) wrote : | #33 |
I can very well understand that it is hard to find a solution for this bug as long as there are too few windows developers. Unluckily I have no idea of programming, so I wont be able to help any on this.
I have however some knowledge on marketing. From this point of view, I'd say that it might be best to just call the windows release delayed in the hope that a solution might be found later.
I think that this would be better than the other solutions mentioned, for example calling Windows not supported, releasing it with printing disabled or releasing it just as is.
In any case, I'd recommend to be honnest on this point and not try to hide it. If the windows user learn about the new version, then download it and start using it, just to discover that printing doesn't work, that will give a much worse image than if it's clear from the beginning on that the new Windows version is delayed.
Simon
PS: There was the idea of a bounty on this bug. I'd be willing to contribute. How much time/money would be needed to pay someone to find a solution for this bug? And would there be anyone willing to work in it?
Alvin Penner (apenner) wrote : | #34 |
running win32 nightly build Inkscape0802291
still no printing and no crash, however, the message has changed, the new message is
C:\Python25\
_cairo_
Never tried this before, but the procedure Save As PDF via Cairo works well, produced a readable pdf file.
However, on exit I got the following DOS messages
C:\Python25\
576.000000 576.000000
** (inkscape.
** (inkscape.
(inkscape.
DGET_CAN_DEFAULT (widget)' failed
bbyak (buliabyak) wrote : | #35 |
Sorry for an uninformed suggestion, but when did this problem appear? Maybe we can find and revert the change that triggered it? I always thought it was something with Kees' print redesign.
Bryce: I agree with those who say we must NOT release with this bug. No matter if someone is named as a blameperson for this or not, it's just not acceptable. If we can't fix it, we must, yes, simply wait until someone comes along. Meanwhile it'd make more sense to make some noise about this bug, e.g. on the devel list. With 400+ subscribers it has a lot of people to appeal to, especially if we honestly admit that this is holding back the release.
Rygle (rygle) wrote : | #36 |
I think that, regardless of your position on Windows as an operating system, or Windows users, that putting out a release that is crippled would be downright humiliating to the *whole* Inkscape project.
Let's ask, what is pushing us so hard to get the next release out? In a lot of these projects there is an impetus based on saving face, which is about bringing new features to fruition. IMHO, the saving face needs to be done by being a little patient, or at the very least not releasing 0.46 for Windows until it is pretty right.
Again, what is the aim? Is it purely to further the name of Inkscape, or is there at least some desire to further SVG as a viable option is a largely proprietary world? I have heard that said a number of times, and used as a reason to include or reject features. This project is meant to be about a good SVG editor, and the rest is a nice by-product. Again, a good reason to hold off just a little.
Let us also ask, if Linux users are so technically superior, aren't they already using the release candidate, which offers pretty much what the release will? Surely even the nightlies are very stable by now if all the bugs are ironed out. If so, in at least one sense who cares if there's a release if the RC is working and those who want the release are already using it! Linux users are well and truly used to beta and release candidates, and in fact the pure only use the bleeding edge stuff and look down on those who don't. Or are we next going to start railing against Ubuntu users for their lack of technical expertise, and because they need a packaged version? Afterall, isn't Ubuntu trying to attract that Windows-like person?
Lets please hold off just a little, at the very least on the Windows release. For many Linux users it makes no difference whether or not there's an official release, because the pre2 package is stable. For the Windows users, and the reputation of Inkscape, SVG, and even FOSS, it makes a huge difference.
Bryce Harrington (bryce) wrote : | #37 |
Kees simply implemented the common gnome print dialog that uses standard cairo interfaces for printing, in a cross-architecture fashion. Adrian and Ishmal point to upstream bug http://
Bulia, your alternative suggestion for reverting the new print dialog back to the old one, would also be acceptable to me, if you code it to only take effect on Windows (i.e., either using ifdefs or an option). In browsing the svn log, it looks like kees introduced these changes in r16655, r16860, r16865, r16866. Please send me this patch by Tuesday if you could?
I am also open to the proposal by Rygle, Mental, and others that a Windows version of Inkscape not be advertised if this bug cannot be resolved prior to the release. This should be the last fallback if neither of the prior two options work out in time. This would enable us to release in time to be included in the next round of LInux distros (Ubuntu Hardy entered feature freeze Feb14, and goes to Beta Freeze March 13th; Fedora 9 foes into feature freeze March 4th, and beta release March 13th with Final Development freeze April 8). Otherwise, it'll be another 6 months before we have the opportunity to get Inkscape out to Linux users officially.
Bryce Harrington (bryce) wrote : | #38 |
<bryce> cworth: if you're around, can I ask what your timeframe is for cairo 1.6? It's looking like one of our remaining critical bugs is contingent on a cairo 1.6 change.
<cworth> bryce: weeks not months for 1.6 certainly
bryce: And it *might* be days not weeks, but I can't promise that yet.
<bryce> cworth: ok thanks
Okko7 (okko7) wrote : | #39 |
Anyone has some more detailed information on how to test the mentioned? I'd be glad to test, but I'm enough computer savvy to know how to test it without additional instructions.
Simon
Bryce Harrington (bryce) wrote : | #40 |
Hi Simon,
Essentially, you need to get the cairo SVN code, take this patch: http://
There are some more detailed directions about building Inkscape for Windows at http://
Simon, thanks greatly for offering to test this. I know it can be a bit of a challenge, but this is something that could greatly help out the project.
Changed in inkscape: | |
milestone: | none → 0.46 |
Changed in inkscape: | |
assignee: | nobody → pittos |
status: | Confirmed → In Progress |
Changed in inkscape: | |
status: | In Progress → Fix Released |
Changed in inkscape: | |
status: | Fix Released → In Progress |
Changed in inkscape: | |
status: | In Progress → Fix Released |
100 comments hidden Loading more comments | view all 180 comments |
Bryce Harrington (bryce) wrote : | #141 |
The patch causes this build error on Linux:
g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/
mv -f $depbase.Tpo $depbase.Po
extension/
make[2]: *** [extension/
make[2]: Leaving directory `/home/
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/
make: *** [all] Error 2
Rygle (rygle) wrote : | #142 |
Bryce: Thanks for your help. When is the deadline on all this 0.46.0 stuff?
The fontfactory.h thing is a windows only dependency related to pango (it's in src\libnrtype), and I think it needs an #ifdef win32. Does this seem correct?
+#ifdef WIN32
+#include "FontFactory.h" // USE_PANGO_WIN32
+#endif
I think it's possible that more #ifdef WIN32 ... #endif statements are needed in the patch. I'm checking, but I'm no programmer.
Rygle (rygle) wrote : | #143 |
That last bit is in src\extensions\
There are only a few other bits in the current patch that don't seem to have ifdefs and may affect other platforms
The first four added lines here;
==========
@@ -1421,16 +1426,33 @@
{
// create a cairo_font_face from PangoFont
double size = style->
+ cairo_font_face_t *font_face = NULL;
+
+ FcPattern *fc_pattern = NULL;
+
+#ifdef USE_PANGO_WIN32
==========
This just seems to be an improvement of code for everyone;
========
- if (FcPatternGetDo
+ if (fc_pattern && FcPatternGetDou
========
And so does this;
========
cairo_
- cairo_font_
-#else
- (void)size;
- (void)fc_pattern;
+ if (font_face)
+ cairo_font_
- cairo_restore(_cr);
-#endif
-
========
So I think just one #ifdef WIN32 ... #endif needed for the #include "Fontfactory.h"
Will test now on Windows.
Rygle
Rygle (rygle) wrote : | #144 |
For ui\dialog\
Should the ifdef be earlier here? Before the //ctx->setPSLevel? Or before the cairo_t?
============
- bool ret = ctx->setSurface
- if (ret) {
+
+ // ctx->setPSLevel
+ ctx->setTextToP
+ ctx->setFilterT
+ ctx->setBitmapR
+
+ cairo_t *cr = gtk_print_
+ cairo_surface_t *surface = cairo_get_
+#ifdef WIN32
+ if (cairo_
+ HDC dc = cairo_win32_
+ surface = _cairo_
+ }
+#endif
+
+ bool ret = ctx->setSurface
==========
And should there be an ifdef on this, since Linux are not having the issue with scaling?
========
+ gtk_print_
========
Rygle (rygle) wrote : | #145 |
- ink_win32.046.print.patch Edit (5.4 KiB, text/plain)
Can someone try this patch on Linux (Bryce??). It just has the added #ifdef WIN32 ... #endif in src/extension/
Cheers, Rygle
Rygle (rygle) wrote : | #146 |
Adrian: What do you think we should do about fallback?
Here's some comparisons for the spool files for the above creation scene file - https:/
HP LJ 4550 Colour PS3 (Can't set dpi, but max is 600);
0.45.1 - 114Mb and great
0.46 branch - unpatched fallback - 424Kb and very pixelated
0.46 branch - x_dpi, y_dpi fallback - 1.55Mb and moderate pixelation
Lexmark Optra T616 Greyscale PS3 (dpi set to 1200);
0.45.1 - 24Mb and great
0.46 branch - unpatched fallback - 41Kb and very pixelated
0.46 branch - x_dpi, y_dpi fallback - 244Kb and moderate pixelation
0.45.1 was always slow on printing because of the large spool files. This seems to have vastly improved things as far as spool size, and probably memory usage.
I think there must be something affecting the dpi in the cairo context setup, which thus affects the x_dpi and y_dpi fed to fallback. Hopefully we can fix this for 0.46.1.
Rygle.
Rygle (rygle) wrote : | #147 |
Just did a build with the fallback set at 300dpi and it prints almost exactly the same as leaving the fallback unpatched. 40.4Kb and very pixelated
Printed it out and on the giraffe I can literally count how many pixels are in an inch (well 2.54cm) because it has a constantly changing colour that makes successive pixels different colours. It's printing at about 18 or 19 dpi. It's like playing a game on a commodore 64 emulator.
This leads me to think the default fallback is still 300dpi, as there is no difference between unpatched fallback and patched with hard 300dpi, but there's something else going wrong. Could it be the scale command that scaled this up from the tiny print that we were getting before?
Adrian Johnson (ajohnson-redneon) wrote : | #148 |
Rygle wrote:
> Just did a build with the fallback set at 300dpi and it prints almost
> exactly the same as leaving the fallback unpatched. 40.4Kb and very
> pixelated
>
> Printed it out and on the giraffe I can literally count how many pixels
> are in an inch (well 2.54cm) because it has a constantly changing colour
> that makes successive pixels different colours. It's printing at about
> 18 or 19 dpi. It's like playing a game on a commodore 64 emulator.
>
> This leads me to think the default fallback is still 300dpi, as there is
> no difference between unpatched fallback and patched with hard 300dpi,
> but there's something else going wrong. Could it be the scale command
> that scaled this up from the tiny print that we were getting before?
>
>
I've found the bug in cairo that is causing this. The problem is we are
scaling the Windows DC from
the default 1 unit = 1 printer pixel to 1 unit = 1/72" with this code
+ SetGraphicsMode (hdc, GM_ADVANCED);
+ xform.eM11 = x_dpi/72.0;
+ xform.eM12 = 0;
+ xform.eM21 = 0;
+ xform.eM22 = y_dpi/72.0;
+ xform.eDx = -x_off;
+ xform.eDy = -y_off;
+ SetWorldTransform (hdc, &xform);
However this is causing a cairo to reduce the resolution of the fallback
images by a factor of dpi/72.
I'll have a look at what it will take to fix the problem in cairo. There
are couple of workarounds that
Inkscape can use. One workaround is to remove the above code and instead
scale the cairo content;
eg
cr = cairo_create (surface);
cairo_scale (cr, x_dpi/72.0, y_dpi/72.0);
The other, and likely the simpler, workaround is to scale up the
fallback resolution by dpi/72.
eg
surface = cairo_win32_
cairo_
(y_dpi/72.0) * y_dpi);
or to use a fixed 300 dpi:
surface = cairo_win32_
cairo_
(y_dpi/72.0) * 300);
Rygle (rygle) wrote : | #149 |
This is great Adrian.
I did do a bitmap export of the file at 200dpi and I was very happy with the resolution on that, which is partly why this has been bugging me.
As soon as I can I will do a build with the fixed 300, since that is ultimately what you thought was a reasonable max. Just in the middle of another build to test my master patch for SVN bugs 1-5. Man, I wish my PC could do 2 builds at once.
Rygle (rygle) wrote : | #150 |
I've also found another printing bug with masks.
In the creation scene (see https:/
Exporting to bitmap works fine on 0.46. Printing to bitmap (Render as bitmap) works fine also on 0.46. Save as PDF keeps the turtle but loses all blurs (not implemented) and the mask, so his legs are fully visible. I think PDF should be capable of a blend to transparent, because the leaves on the bushes blend to transparent and they export to pdf beautifully.
I'm also puzzled why printing to bitmap produces a 117Mb file @ 90dpi, while exporting to bitmap produces an almost identical quality picture that's 495Kb at 90dpi. The export is a png, but that's a heck of a difference. Is it that export is using the imagemagick dll or similar, while print to bitmap is using cairo?
Adrian Johnson (ajohnson-redneon) wrote : | #151 |
The fallback resolution fix for cairo has been committed:
http://
Obviously we want to ensure that Inkscape does not implement the fallback resolution workaround I suggested at the same time as using a libcairo.dll with this fix or else we will get a fallback resolution much higher then it should be.
Adrian Johnson (ajohnson-redneon) wrote : | #152 |
As far as I know masks are correctly implemented by cairo in the PDF backend.
Based on comment 61 there are two different cairo renderers for PS and PDF.
$ grep cairo_mask *
cairo-render-
cairo-render-
cairo-render-
Only one of them is using cairo_mask().
I'm not sure why the print file is 117MB. A 11x8" page at 90dpi is
90*11*90*8*3 = about 2MB. The PNG file would be compressed.
117MB is about 8 times larger (or 600/72) which suggests there is a scaling problem somewhere due to difference between the printer resolution and 72dpi.
I can't think of anything in cairo that would cause this other than printing a transparent image on top of something else which would force cairo to use a fallback image.
Someone may need to check that the Inkscape code is working correctly.
Adrian Johnson (ajohnson-redneon) wrote : | #153 |
Adrian Johnson wrote:
> I'm not sure why the print file is 117MB. A 11x8" page at 90dpi is
> 90*11*90*8*3 = about 2MB. The PNG file would be compressed.
>
> 117MB is about 8 times larger (or 600/72)
I didn't explain that very well. If the horizontal and vertical
resolution is increased by 8 the image size increases by 8*8.
Rygle (rygle) wrote : | #154 |
Thanks for all your great work. It's great that this is helping Cairo and all its other beneficiaries too.
I will check out the mask thing a bit more and see what happens.
I'm wondering whether the file sizes might be to do with ascii vs binary. Looking at the contents of the spool file, it sure looks like ascii to me. Lots of repetition of phrases (not human readable but still phrases).
Adrian Johnson (ajohnson-redneon) wrote : | #155 |
Rygle wrote:
> I'm wondering whether the file sizes might be to do with ascii vs
> binary. Looking at the contents of the spool file, it sure looks like
> ascii to me. Lots of repetition of phrases (not human readable but still
> phrases).
The binary image is encoded in an ASCII encoding that will increase the
size by either 1.25 or 2 times depending on the encoding used. Certainly
not enough to explain the file size difference.
Does the image look like it is 90dpi or something higher?
Rygle (rygle) wrote : | #156 |
Both exported @ 90dpi and printed @ 90dpi look about the same. It's just the size that's different.
At first I thought the printed was less clear, but then I realised that GSview uses graphics alpha/antialiasing and that was affecting things a bit.
Doing that build now. About 20 minutes left.
Rygle (rygle) wrote : | #157 |
Excellent! Much, much better! This has taken a weight off my mind.
Hard coded as follows;
cairo_surface_
Spool for HP Colour PS3 is 26Mb and looks good
Spool for Apple Colour PS2 is 25.5Mb and looks good
Spool for Lexmark Grayscale PS3 is 2.24Mb and looks good - on paper this looks equivalent to 0.45. In fact the contrast is better in 0.46 and there is a slight banding in the 0.45 gradients that isn't there in 0.46
So now, I will resubmit the patch with the fallback bit commented out (with some explanatory stuff), and we will have to talk to Ishmal about cairo again, and hope it makes it in, or at least co-ordinate the fix against the cairo build.
Just need to sort two more things and I'll be really happy;
* Blur scaling and alignment
* Masks
Rygle (rygle) wrote : | #158 |
Is there some conditional thing we can use to test whether cairo has this fix? That would be cleaner in some ways and messier in others I guess.
Could do something like;
=====
#ifndef have_cairo_1.6 // (or whatever the correct call is)
cairo_surface_
#endif
=====
But then I guess that would then have to be changed for every version of cairo, so it's not worth it.
Rygle (rygle) wrote : | #159 |
Another possibility for conditional code would be to read the x_dpi resolution setting, and if it's less than a certain amount, the substitute code could kick in
Here is my guess of what it might look like in C++
#if x_dpi < 150 // (or whatever the correct call is for less than)
cairo_surface_
#endif
Rygle (rygle) wrote : | #160 |
Here's what I'm working on at the moment for ui\dialog\print.cpp - will do a build soon and see if it works. This should allow us to work with Cairo whether it has a scaling bug or not.
======
// Alternative Fallback 1. Set resolution of fallback to printer resolution. If everything is working properly this will set the resolution much higher than actually needed as printer halftoning means laser printers don't need much more than 300dpi. Leave commented unless you know what you're doing.
// cairo_surface_
// Alternative fallback 2. Set fallback to 300 dpi, compensating for cairo scaling bug
// cairo_surface_
// Alternative fallback 3. Conditional fallback -> 300dpi, only if the dpi is set to less than 100dpi due to cairo bug.
if x_dpi < 100 {
}
======
Adrian Johnson (ajohnson-redneon) wrote : | #161 |
Rygle wrote:
> Is there some conditional thing we can use to test whether cairo has
> this fix? That would be cleaner in some ways and messier in others I
> guess.
>
> Could do something like;
> =====
> #ifndef have_cairo_1.6 // (or whatever the correct call is)
> cairo_surface_
> #endif
> =====
>
> But then I guess that would then have to be changed for every version of
> cairo, so it's not worth it.
>
As Inkscape ships the libcairo.dll with the Inkscape binary it is
probably not worth trying to make the code work for different versions
of cairo. The win32_printing_
development snapshots. The first stable release (1.6.0) that will
include the win32_printing_
Rygle (rygle) wrote : | #162 |
Tried this, but it doesn't set the fallback to 300. Oh well, worth a try. Hopefully Ishmal can build the patched cairo and we won't need this...
==========
if (x_dpi < 100) {
return surface;
}
else {
return surface;
}
==========
Rygle (rygle) wrote : | #163 |
Thanks Adrian. I'll give up. Good practice for me.
Adrian Johnson (ajohnson-redneon) wrote : | #164 |
I've built the latest cairo from git for testing the fallback resolution fix.
The binaries can be downloaded from:
http://
This is built with cairo 1.5.15-6dc75ab0f and pixman 0.9.7-eec44d371
Rygle (rygle) wrote : | #165 |
Excellent. I was just thinking I should ask about that.
It works really well. I just commented the fallback line in ui\dialog\print.cpp and it built and printed beautifully. The only error I got was because my drive got full from 4 versions of the devlibs and all the test print spool files I hadn't deleted yet.
Here's what I've been doing with the patched cairo libs;
* Drop those into the same c:\devlibs\bin directory that the normal libcairo-2.dll goes in
* Replace the normal build.xml in your working directory with the attached file. It adds a single entry for the pixman dll, so it gets copied automatically with the build.
Well, I think we're very close to a release. I'm tempted to put out my own 0.46 win32 pre4 version somewhere.
Rygle (rygle) wrote : | #166 |
- 01_win32_printing.patch Edit (5.8 KiB, text/plain)
Can this patch be updated in 0.46 branch?
Have improved Linux compatability in response to Bryce's comments;
- https:/
Have removed cairo fallback workaround, which are fixed by Adrian's patched dlls and/or new devlibs from Ishmal;
- https:/
Rygle (rygle) wrote : | #167 |
- 01_win32_printing.patch Edit (5.9 KiB, text/plain)
Sorry, typo in src/extension/
Fixed version attached.
Rygle (rygle) wrote : | #168 |
Changing to fix released so Launchpad counts as closed in stats
Changed in gtk: | |
status: | New → Fix Released |
Adrian Johnson (ajohnson-redneon) wrote : | #169 |
A new version of GTK+ has been released with the fix to make GtkPrint use the cairo_win32_
Okko7 (okko7) wrote : | #170 |
That's great news. I kept both versions of Inkscape on my computer, that is 0.47 for general work, and 0.46 for printing.
Will the new GTK+ version be included in the stable release or only in the development version? Or is there a way to update only GTK+?
Thanks
Okko7
Alvin Penner (apenner) wrote : | #171 |
- running Win32 Inkscape19816-
- with regret, I am going to re-open this bug since the printed output is one eighth of the normal size, as predicted in comment 169
Adrian Johnson (ajohnson-redneon) wrote : | #172 |
Before the GTK+ update, Inkscape was scaling the printer DC and creating it's own cairo_win32_
Inkscape is correctly setting the gtk_print units to points. The problem is that Inkscape is getting the target surface from the print context then passing the surface to the renderer. As a result the scale that gtk_print sets on the print context is not used. One solution would be to use cairo_get_matrix() to get the scale from the print context and set it on every new context created from the target surface.
Alvin Penner (apenner) wrote : | #173 |
- just writing to confirm that the scaling issue still exists.
- running Windows build 21165
- on a printer with a resolution of 300 dpi, the image is too small by a factor of 4.2
- on a printer with a resolution of 360 dpi, the image is too small by a factor of 5.0
- this suggests that the image would be correct size on a printer with a resolution of 72 dpi.
Adrian Johnson (ajohnson-redneon) wrote : | #174 |
Alvin Penner (apenner) wrote : | #175 |
thanks Adrian !
would someone be willing to test this on Windows and commit it?
unfortunately I work only from the nightly builds, so cannot test it before committing.
Adrian Johnson (ajohnson-redneon) wrote : | #176 |
- Remove old gtk-print workaround Edit (2.3 KiB, text/plain)
Now that the devlibs include gtk+ 2.14 the fix for win32 printing on versions of gtk+ prior to 2.14 can be removed.
theAdib (theadib) wrote : | #177 |
I commit the patches :
https:/
https:/
from <adrianj> and printing scale is ok for me. Now svn revision 21212.
Adib.
Rygle (rygle) wrote : | #178 |
Tested build 21213 and seems to scale printing properly for me. Thanks very much Adrian, Adib and Alvin. Great to finally have this sorted!
Rygle (rygle) wrote : | #179 |
Largley fixed in 0.46 release, however 0.47 has significantly improved printing for the Win32 platform. If you are concerned about this bug please move to 0.47 or later. The final patch will probably not work for 0.46 release code as it used much earlier dev libs.
Alvin Penner (apenner) wrote : | #180 |
thanks Adrian and Adib !
Changed in gtk: | |
importance: | Unknown → Critical |
Confirmed on WinXP, Inkscape0801111659. Backtrace:
#0 0x63c90f28 in FcPatternObject Position () Inkscape\ libfontconfig- 1.dll FindElt () Inkscape\ libfontconfig- 1.dll Inkscape\ libfontconfig- 1.dll GetString () Inkscape\ libfontconfig- 1.dll ft_unscaled_ font_create_ for_pattern () Inkscape\ libcairo- 2.dll font_face_ create_ for_pattern () Inkscape\ libcairo- 2.dll textdomain_ codeset ()
from c:\Program\
#1 0x63c90f81 in FcPatternObject
from c:\Program\
#2 0x63c9142c in FcPatternObjectGet ()
from c:\Program\
#3 0x63c91626 in FcPatternObject
from c:\Program\
#4 0x68deb560 in _cairo_
from c:\Program\
#5 0x68deef12 in cairo_ft_
from c:\Program\
#6 0x006bfc5f in intl!bind_
#7 0xfffffe00 in ?? ()
#8 0x07ebdc68 in ?? ()
#9 0x003f0000 in ?? ()
#10 0x00000000 in ?? ()