Bug 239205 - gtkhtml38: Printing from gnucash uses different fonts than print preview
Summary: gtkhtml38: Printing from gnucash uses different fonts than print preview
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gtkhtml38
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-05-06 01:44 UTC by Bernard Johnson
Modified: 2014-03-17 03:06 UTC (History)
3 users (show)

Fixed In Version: 2.1.4-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-06-27 05:25:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
print preview of how fonts should look from gnucash (56.82 KB, image/png)
2007-05-06 01:44 UTC, Bernard Johnson
no flags Details
example pdf before the patch is applied (wrong fonts) (630.57 KB, application/octet-stream)
2007-05-06 01:45 UTC, Bernard Johnson
no flags Details
example pdf after the patch is applied (matches print preview) (633.96 KB, application/octet-stream)
2007-05-06 01:46 UTC, Bernard Johnson
no flags Details
capture of the actual report in gnucash (91.46 KB, image/png)
2007-05-06 01:55 UTC, Bernard Johnson
no flags Details

Description Bernard Johnson 2007-05-06 01:44:29 UTC
Description of problem:
Bug upstream regarding this:
http://bugzilla.gnome.org/show_bug.cgi?id=350408#c15

Explanation of the problem from the developer of the patch:
http://members.iinet.com.au/~paulone/gnucash/

The patch:
http://members.iinet.net.au/~paulone/gnucash/print-font-gtkhtml3.8-fix.patch

This is a little more serious than just "ugly" printouts.  If the font is wrong,
and there are enough columns, the print area leaks over the right margin and
information is lost.

Version-Release number of selected component (if applicable):
gtkhtml3-3.12.3-1.fc6

Comment 1 Bernard Johnson 2007-05-06 01:44:29 UTC
Created attachment 154216 [details]
print preview of how fonts should look from gnucash

Comment 2 Bernard Johnson 2007-05-06 01:45:20 UTC
Created attachment 154217 [details]
example pdf before the patch is applied (wrong fonts)

Comment 3 Bernard Johnson 2007-05-06 01:46:27 UTC
Created attachment 154218 [details]
example pdf after the patch is applied (matches print preview)

Comment 4 Bernard Johnson 2007-05-06 01:55:44 UTC
Created attachment 154219 [details]
capture of the actual report in gnucash

I mean to say that the print preview doesn't match the fonts either.  That was
a typo.

This is the capture of how the fonts should look.

Comment 5 Matthew Barnes 2007-05-08 15:45:00 UTC
Thanks for the detailed bug report!

I'm changing the version from 'fc6' to 'devel' since it's too late to really do
anything about this in Fedora Core 6 and the problem still exists in even the
latest revision of the upstream source code repository.

The patch looks reasonable but as Paul mentioned, as of version 3.14 GtkHtml is
using GtkPrint rather than GnomePrint.  So I'll have to re-evaluate it.

It just so happens that I'm planning on ripping into GtkHtml's printing API
(again) to better integrate with GtkPrint's approach to pagination.  As it
stands now, the API makes it very difficult to honor user selected page ranges
when printing.

I'll make sure to expose the default font in the API, as Paul suggests.

Comment 6 Bernard Johnson 2007-06-08 21:49:11 UTC
Also happens in F7 as gnucash relies on gtkhtml38.

Comment 7 Bernard Johnson 2007-06-20 06:24:40 UTC
Given the small number of applications that are even using gtkhtml38, don't you
think it would be safe to apply this patch and push to F-7 updates & rawhide?

(this is on F-7)
repoquery --all --whatrequires libgtkhtml-3.8.so.15
gnotime-0:2.2.2-7.fc6.i386
gtkhtml38-devel-0:3.12.3-4.fc7.i386
gnucash-0:2.0.5-3.fc7.i386
gtkhtml38-0:3.12.3-4.fc7.i386
gnomesword-0:2.2.3-1.fc7.i386


Comment 8 Bill Nottingham 2007-06-20 15:43:42 UTC
As it's changing the code in a non-upstream way... not really. Matt, as
upstream, what's your opinions on changing the dead-end code in this way?

Comment 9 Matthew Barnes 2007-06-20 21:00:03 UTC
I haven't tested the patch at all, but it looks reasonable and doesn't break any
interfaces.  Might be worth trying it out in Rawhide.  If it works that could
increase its chances of a version of the patch that works with GtkPrint getting
accepted upstream.  I'd be leery of putting it in Fedora 7.

Comment 10 Bill Nottingham 2007-06-20 21:10:25 UTC
Heh. Of course, in the near future gnucash will probably get upgraded in rawhide
to a version that uses the current gtkhtml. 

Added in -5.

Comment 11 Bernard Johnson 2007-06-21 04:33:45 UTC
(In reply to comment #9)
> I'd be leery of putting it in Fedora 7.

Looking at the two other programs that actually depend on gtkhtml38... Neither
of them has printing capabilities.  If the patch only affects printing, I don't
see how this is even risky. (Maybe the patch affects things other than printing?)



Comment 12 Matthew Barnes 2007-06-21 05:22:35 UTC
The patch modifies htmltext.c, which may affect general rendering of HTML and
not just printing.  But probably in a good way.

You might also be interested in the GtkHtml printing work I'm currently
targeting for the next GNOME release.  It extends GtkHtml's printing API to
allow for printing individual pages or custom page ranges, among other things. 
See [1].

[1] http://bugzilla.gnome.org/show_bug.cgi?id=446894

Comment 13 Bernard Johnson 2007-06-26 23:36:20 UTC
(In reply to comment #10)
> Heh. Of course, in the near future gnucash will probably get upgraded in rawhide
> to a version that uses the current gtkhtml. 

Doesn't seem to affect the gnucash/gtkhtml combo in rawhide.


Comment 14 Bill Nottingham 2007-06-27 03:21:28 UTC
Oops, if you've upgraded to 2.1.4, you're using gtkhtml-3.14.

Comment 15 Bernard Johnson 2007-06-27 04:17:54 UTC
(In reply to comment #14)
> Oops, if you've upgraded to 2.1.4, you're using gtkhtml-3.14.

Yeah, which was my point.  gnucash-2.1.4/gtkhtml-current doesn't seem to carry
this particular bug.

Comment 16 Bill Nottingham 2007-06-27 05:25:37 UTC
Oh, I thought you meant the *change* didn't fix it. If it's working now, I'll
close this.

Comment 17 Bernard Johnson 2007-06-27 06:04:01 UTC
Let me be more clear:

This bug does not exist with gnucash-2.1.4/gtkhtml-current in rawhide.

:)

Sorry for the terseness I sometimes exhibit!


Note You need to log in before you can comment on or make changes to this bug.