After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 350408 - Incorrect fonts in reports and their print preview
Incorrect fonts in reports and their print preview
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Reports
2.2.x
Other All
: Normal normal
: ---
Assigned To: Chris Lyttle
Chris Lyttle
: 361828 (view as bug list)
Depends on:
Blocks: 473506
 
 
Reported: 2006-08-08 10:31 UTC by Bojan Smojver
Modified: 2018-06-29 21:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Incorrect fonts in print preview (26.03 KB, image/jpeg)
2006-08-08 10:33 UTC, Bojan Smojver
  Details
Patch from http://members.iinet.net.au/~paulone/gnucash/print-size-fix.patch (6.73 KB, patch)
2007-08-23 01:06 UTC, Paul Gear
committed Details | Review

Description Bojan Smojver 2006-08-08 10:31:46 UTC
Please describe the problem:
The program doesn't respect font choices when printing reports. It substitutes the chosen system font with another, therefore causing the report to look different on the screen and on the print preview/PDF/printout.

Steps to reproduce:
1. Create a report.
2. Go to print it.
3. Pick print preview.


Actual results:
The fonts in print preview are incorrect.

Expected results:
The fonts should match the ones on the screen.

Does this happen every time?
Yes.

Other information:
The screen shot of program look and print preview look will be attached.
Comment 1 Bojan Smojver 2006-08-08 10:33:37 UTC
Created attachment 70473 [details]
Incorrect fonts in print preview

On the left is how fonts look in GnuCash reports. On the right is what they look like in print preview or created PDF. BTW, this is on Fedora Core 6 (Development) with Deja Vu fonts.
Comment 2 Des Dougan 2006-09-10 20:02:56 UTC
Same behaviour is displayed on SuSE 10.0 with GnuCash 2.0.1 (self-compiled). The gnome-print version is 0.37-7.
Comment 3 Rodd Clarkson 2006-10-13 01:50:19 UTC
*** Bug 361828 has been marked as a duplicate of this bug. ***
Comment 4 Rodd Clarkson 2006-10-13 01:51:26 UTC
I think this bug can be confirmed as a problem.  Three people, including the report, have noted this problem.
Comment 5 Bojan Smojver 2006-10-28 23:26:48 UTC
Tried it with version 2.0.2 (2.0.2-1.fc6) in FC6 updates-testing. Still the same.
Comment 6 Doug Durning 2006-11-30 23:19:51 UTC
Just upgraded gnucash to version 2.0.0 from 1.8.12 and have the same problem with printing fonts.  Thay are HUGE and my customer invoices look goofy.  I've tried a manual compile of gnucash 2.0.2 on FC5 and FC6 with the same results.  I think it is related to the call to gnome_font_find_closest((guchar *)"Sans Regular", 12) in  the print-session.c file.
Comment 7 Bojan Smojver 2007-01-16 02:38:40 UTC
Just upgraded to gnucash-2.0.4-1.fc6 and the issue is still there.
Comment 8 Nassib Nassar 2007-01-17 21:38:54 UTC
I'm seeing this problem as well with gnucash-2.0.4-1.fc6.  Apparently as a result, the report does not fit on the page and is cut off.  This seems fairly critical (at least for me), as there does not appear to be a workaround.
Comment 9 Rodd Clarkson 2007-01-18 02:01:05 UTC
I would have thought that this would have been classed as a fairly serious regression since printing worked fine in 1.8.x and now doesn't work in any useable sense.

Maybe the reporter should change the priority and severity to highlight that people expect printing of reports to just work.

Comment 10 Nassib Nassar 2007-01-18 02:18:53 UTC
(In reply to comment #9)
> I would have thought that this would have been classed as a fairly serious
> regression since printing worked fine in 1.8.x and now doesn't work in any
> useable sense.
> 
> Maybe the reporter should change the priority and severity to highlight that
> people expect printing of reports to just work.
> 

My case is anecdotal evidence in support of this.  I never thought to test printing of reports before upgrading, until I actually needed it (today).

As a follow-up to my earlier comment, I did find a partial workaround, which was to remove some columns from the register report: Num and Balance.  This allowed the report to fit on a page without being cut off on the right.  It's not a great solution, but maybe better than not printing at all.
Comment 11 Nassib Nassar 2007-01-18 02:24:30 UTC
Sorry, one more note.  I also tried printing in Landscape orientation to get around the horizontal cut-off problem.  In that case, multiple lines seemed to be missing in between pages, suggesting that the report was severely cut off (vertically).  I haven't had time to pin that down precisely as a bug, but it may be worth noting.
Comment 12 James Strandboge 2007-02-07 13:08:58 UTC
I have the same problem, and so do my clients.  If you have too many columns, the page gets clipped on the right.

What has worked somewhat is to export as an HTML file and then print the report in a browser (eg firefox).  This seems to work fairly well (though I did have some margin problems with at least one report).

Incidentally, the title of this page is misleading.  It should be something along the line of 'Incorrect printing and preview of reports' or something.

gnucash 2.0.2
Comment 13 James Strandboge 2007-02-08 15:16:57 UTC
The situation may improve some when this bug is addressed:
http://bugzilla.gnome.org/show_bug.cgi?id=405750

With the current situation, you may be able to use the following workaround:

Under Options/Display, uncheck 'Use Full Account Name?' and 'Use Full Other Account Name?'. The report should print properly if you don't use too many columns.  For example, having the following columns works properly (at Application Font size 10 and 13 at least):
Date
Num
Description
Other Account Name
Running Balance
Totals

However, being able to reduce the font size, or better yet having the report scale automatically to a smaller font size when the width is too large would fully address this issue.
Comment 14 Bojan Smojver 2007-02-26 21:08:20 UTC
Still the same in gnucash-2.0.5-1.fc6.
Comment 15 Paul Andreassen 2007-04-16 13:56:21 UTC
Here is my fix for this problem http://members.iinet.com.au/~paulone/gnucash/
Comment 16 bjohnson 2007-05-06 01:41:18 UTC
Paul's fix in comment #15 worked great for me.
Comment 17 Jani Patokallio 2007-06-01 06:29:11 UTC
I'd just like to add a "Me too" -- this is a severe bug and has been confirmed many times over (Gnucash 2.0.2 on Ubuntu 7.04, in my case).
Comment 18 leigh 2007-07-11 01:12:13 UTC
Me too, this is very unprofessional, and makes gnucash impossible for people running a business
Comment 19 Rodd Clarkson 2007-07-11 10:49:48 UTC
I'm trying to keep my mouth shut about how bad this is, but seriously we're fast coming up on this bugs first birthday.  And it's still unresolved.

Or, put another way, it appears that the next stable version of gnucash is nearing completion and for a complete release cycle we haven't been able to do something as simple as print a report without having to export it to html and then print from there (after editing the html so that things are aligned properly).

Comment 20 leigh 2007-07-12 06:56:48 UTC
Yeh try paying a receptionist to go thru and export to HTML, print to PS and convert that PS to PDF, then add that attachment to email, now that this for 300 invoices - this is definately not cool, as well as trying to tout all the benefits of opensource technology...
Comment 21 leigh 2007-07-12 07:27:43 UTC
What is the suggested way to improve this?



Interesting the invoice report itself looks really really good, what generates this? can this be converted to postscript (and subsequently to PDF?)

Maybe we add another layer where you can see how the current print setup fitswith the report by showing the page width (light blue lines for the border of an A4 behind the report) etc ?

I dont mind doing some work on this, but these kinds of issues always come up in gnome applications, what is the gnome's official view of how to handle printable information, do we show the print preview blended in with it?
Comment 22 Jani Patokallio 2007-07-12 07:51:11 UTC
The issue is known -- due to a bug in libgtkhtml3.8, the printed report uses GnomePrint's default font -- and comment #15 suggests a patch for GnuCash that allows different fonts.  So it's just the developers sleeping on the job...?

Comment 23 Nassib Nassar 2007-07-12 12:46:14 UTC
We really appreciate the work on this software-- the fact that it is so useful is why so many people are relying on it and hope this problem can be fixed.  I think the issue is that this bug should be prioritized above any new features.  If there are people here with ability to work on this, maybe the developers could outline debugging or coding tasks or an overview of the preferred way to fix this....  (I'm a programmer and willing to try, but I'll be completely new to gnome and printing)
Comment 24 bjohnson 2007-07-12 16:20:33 UTC
You might start by getting this bug assigned to the correct component (gtkhtml).  

Please note that the version of gtkthml that gnuchash is built against is also not being actively developed any longer, so don't hold your breath on getting it fixed.

See also:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239205

Newer versions of Gnucash/gtkhtml in Fedora rawhide does not exhibit this problem.
Comment 25 Jani Patokallio 2007-07-16 06:48:45 UTC
Sorry, I'm not following you here.  You're saying that a) this is not gnucash's problem and b) there are now newer versions of gtkhtml that fix the problem.  So does Gnucash 2.2 -- which I see was released yesterday -- require this newer version of gtkhtml, so distributions will be built correctly and printing will actually work?
Comment 26 bjohnson 2007-07-16 07:52:31 UTC
I am no expert, but I believe that everything you just said is true. [1]

[1] It may not "require" newer gtkhtml, but when built against it, it does seem to fix the problem.
Comment 27 Bojan Smojver 2007-07-22 02:09:48 UTC
Indeed this works now with GnuCash 2.2.0-1.fc7 (i.e. the system font is obeyed).

The produced PDF looks a bit funny with DejaVU LGC fonts (font spacing and kerning is weird - some letters are either too far apart or too close together), but that's probably a different cattle of fish.

Also, for whatever reason, my invoices (which fit on one page) now have page 2 which is completely blank.
Comment 28 Rodd Clarkson 2007-07-22 10:52:26 UTC
Yeah, I noticed the same second page issue too (running F7).

Also, the items in the various columns don't line up very well.  (And certainly aren't wysiwyg).
Comment 29 bjohnson 2007-07-23 04:03:53 UTC
(In reply to comment #27)
> Indeed this works now with GnuCash 2.2.0-1.fc7 (i.e. the system font is
> obeyed).
> 
> The produced PDF looks a bit funny with DejaVU LGC fonts (font spacing and
> kerning is weird - some letters are either too far apart or too close
> together), but that's probably a different cattle of fish.

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=245852

> Also, for whatever reason, my invoices (which fit on one page) now have page 2
> which is completely blank.

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=245853

Comment 31 John Peach 2007-12-07 06:42:41 UTC
Still the same problem on 2.2.1 using Ubuntu 7.10 with gtkhtml 3.14 installed.
Comment 32 Derek Atkins 2007-12-26 02:49:13 UTC
John, does the patch in comment #30 fix it for you?
Comment 33 John Peach 2007-12-26 05:23:37 UTC
Derek.  No the patch in #30 did not work for me.
Comment 34 Jeff Hinrichs 2008-01-02 04:51:39 UTC
I confirm that the problem still exists on 2.2.1 running on Ubuntu 7.10 with gtkhtml 3.14
Comment 35 Derek Atkins 2008-01-02 19:37:06 UTC
At this point we still believe the problem is GtkHTML.
Comment 36 Jeff Hinrichs 2008-01-02 23:38:38 UTC
What is the bug id for the GtkHTML issue so I can weigh in too?
Thanks,
Jeff
Comment 37 Derek Atkins 2008-01-06 15:47:45 UTC
I'm afraid there isn't a GtkHTML bug # that I know of, as it's only an assumption that it's GtkHTML.  Nobody has done any work to track it down or create a test case.
Comment 38 leighm 2008-01-06 22:20:44 UTC
Yeh the problem is that gtkHTML cant be assigned a default style sheet so in the end, nothing lines up, and last i looked at gtkHTML code, it just hard coded these font sizes (complete with #define FONT_SIZE 12!)

So the problem is that gnucash needs to use a smarter engine for producing/exporting these reports, or some XSLT type methods for rendering them ?
Comment 39 Derek Atkins 2008-01-07 13:28:31 UTC
There's been talk about migrating to GtkMozEmbed or WebKit.  But no developer time to actually do the work.
Comment 40 leighm 2008-01-07 21:37:24 UTC
Can we raise a bounty on this? 
Comment 41 Paul Andreassen 2008-01-08 04:31:17 UTC
> Here is my fix for this problem http://members.iinet.com.au/~paulone/gnucash/

I raised the font problem on the GtkHTML mail list (before posting Comment #15) and their responce was that they don't fix old versions and the best course of action was to upgrade to the new version.  I was in no situation to test if the new version had fixed it.

The easyest fix would be to put my GtkHTML patch in the Ubuntu GtkHTML library.
Comment 42 leighm 2008-01-08 04:50:28 UTC
It never ceases to amaze me how poorly gtk applications integrate into the desktop
Comment 43 marcusj 2008-04-04 09:07:43 UTC
Can we get the priority of this one raised?  If the accounts are to go to my accountant and get filed with the Powers That Be, they need dead-tree format.  And this bug isn't just cosmetic, it causes numbers to fall off the printed page => missing money as far as the government's concerned.  This is rather show-stopping IMHO.
Comment 44 bugreporter 2008-05-01 21:43:41 UTC
I Just compiled gnucash 2.2.5

Still the same problem. Please raise priority! Thanks.
Comment 45 Brice 2008-05-02 05:15:55 UTC
I think I might just start porting the source code for GnuCash over to KDE just to get a properly working print system. The fewer reasons to install Gnome-based libraries, the better. After browsing the bug reports, it looks to me like this bug is a combination of several other bugs in several other libraries.

I just compiled 2.2.5 against the default Debian Etch libraries and the bug is identical to the bug I was experiencing with the GnuCash 2.0.* that was installed through apt repositories.

As a temporary workaround, I am exporting reports as HTML files and then printing them from Konqueror. This seems to work quite well and gives me more printing options than either GnuCash or Firefox. It also gives me the chance to apply a much nicer CSS style to reports before printing.
Comment 46 leighm 2008-05-02 05:22:33 UTC
(In reply to comment #45)
> I think I might just start porting the source code for GnuCash over to KDE just
> to get a properly working print system. The fewer reasons to install
> Gnome-based libraries, the better. After browsing the bug reports, it looks to
> me like this bug is a combination of several other bugs in several other
> libraries.
> 
> I just compiled 2.2.5 against the default Debian Etch libraries and the bug is
> identical to the bug I was experiencing with the GnuCash 2.0.* that was
> installed through apt repositories.
> 
> As a temporary workaround, I am exporting reports as HTML files and then
> printing them from Konqueror. This seems to work quite well and gives me more
> printing options than either GnuCash or Firefox. It also gives me the chance to
> apply a much nicer CSS style to reports before printing.
> 

I completely concur, This is such an old, ugly bug.

What do people do with invoices? PRINT THEM.

What does gnome fail at? PRINTING.

Gnucash is an excellent application, but it is at the mercy of the fundamental issues with the gnome desktop, Printing and Integration (where I may ask, can I  get GnuCash to trigger Evolution to re-email all open invoices? Or even 1 invoice?)

Plus other yucky bugs, like I've seen people export the invoice as HTML then click "save" from the "File" menu - but this actually saves your GNUCASH DATA as the filename you are asking for - and then email this as an attachment! brilliant!

Brice - how much do you think is involved todo this? Is a $200 USD bounty sufficient?



Comment 47 Rodd Clarkson 2008-05-02 09:41:28 UTC
Yeah, currently I'm having to export to HTML.  Edit the file to get the address right aligned and then print them from a browser (Firefox).  Fortunately, Firefox not prints to PDF, but in the past I had to print to ps and then ps2pdf them.

All this so I can send a client a PDF (in an email) that they can read and possibly print.

Shame GnuCash!
Comment 48 Derek Atkins 2008-05-02 13:22:52 UTC
Brice, Re Comment #45..  "porting" to KDE will probably take you a few man-years of effort.  I wish you luck on that.

Re comment #46: GnuCash can "print to PDF" and the invoices work fine for me.  This is a bug in GtkHTML and it's printing integration.

We've been talking about converting out GtkHTML (which SUCKS) to something more modern, like WebKit.  But none of the current developers have the cycles to do that work.  It would be a decent-sized project but it would also be fairly straightforward to swap GtkHTML -> WebKit-Gtk if someone wanted to take on the task.
Comment 49 J. Rosset 2008-05-03 14:40:15 UTC
I can confirm same problem with version 2.2.5. 

But the patches at Comment #15 worked for me with a little change for one file that i had to do by hand.

You can download the new patch for version 2.2.5 at the same place, Comment #15.
I tested them with gnucash version 2.2.5 and gtkhtml version 3.8 (3.10.2).
Comment 50 Derek Atkins 2008-05-05 13:43:17 UTC
While I could take the patches and apply them to gnucash, that wont help because you still need changes to GtkHTML.  But comment #33 shows that changing GnuCash is not sufficient.
Comment 51 Ben Bailes 2008-05-19 20:18:59 UTC
(In reply to comment #15)
> Here is my fix for this problem http://members.iinet.com.au/~paulone/gnucash/
> 

Hi, I am having problems with compiling gnucash2.2.5 (more accurately a bug with guile and slib that has had me banging my head against the screen for a few hours) so am so far unable to install the patch. Unfortunately the older .deb Paul has uploaded that contains the patch and version 2.0. doesn't appear to get on with Ubuntu Hardy Heron.
Is there a possibility that a .deb can be compiled of 2.2.5 with the patch included?

I have been looking for a solution to this problem for months... clearly looking in the wrong place before!

Thanks,
Ben
Comment 52 Paul Andreassen 2008-06-26 14:24:32 UTC
Hi, I've recompiled gnucash 2.2.4 and libgtkhtml3.8 3.13.5 that comes with Ubuntu Hardy 8.04LTS with my patches at http://members.iinet.com.au/~paulone/gnucash/ 
Comment 53 John Peach 2008-10-13 08:09:51 UTC
Paul, have you submitted this patch to the trunk?  If so, this bug can be closed out.
Comment 54 Christian Stimming 2008-10-26 14:44:53 UTC
Err... is there still a patch waiting to be committed into gnucash (trunk and stable branch)? I didn't understand the discussion here. If there is, I'd like to go ahead committing it in the next days.
Comment 55 John Peach 2008-10-26 14:50:35 UTC
I second the nclusion of the patch
Comment 56 Christian Stimming 2008-11-26 21:41:24 UTC
Applied the patch to trunk r17727, but with some manual clean-up. The part in report/report-system/html-acct-table.scm was already applied from bug#366934, r16723. The parts in gnome-utils/gnc-html.c is valid only for the part GTKHTML_USES_GTKPRINT is false; i.e. if GtkPrint is active, this patch is not (yet) being executed and an additional patch is necessary.
Comment 57 scar 2010-10-28 21:36:47 UTC
I am experiencing this issue with v2.3.15 r19580 compiled on Ubuntu 10.04

i am noticing that the font
used when printing a report or invoice is different than what is shown
on the screen.  in fact, it seems, when printing, my system font is
used.
Comment 58 John Ralls 2018-06-29 21:11:04 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=350408. Please update any external references or bookmarks.