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 334011 - printing replaces all characters with different ones
printing replaces all characters with different ones
Status: RESOLVED OBSOLETE
Product: gnome-print
Classification: Deprecated
Component: fonts
2.11.x
Other Linux
: Normal major
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2006-03-09 12:09 UTC by Egmont Koblinger
Modified: 2009-05-17 20:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot (76.67 KB, image/png)
2006-03-09 12:10 UTC, Egmont Koblinger
Details
none of Type1 and TTF is present - printing is okay (35.67 KB, text/plain)
2006-03-09 12:19 UTC, Egmont Koblinger
Details
only TTF - printing is okay (36.07 KB, text/plain)
2006-03-09 12:20 UTC, Egmont Koblinger
Details
only Type1 - printing is okay (36.17 KB, text/plain)
2006-03-09 12:21 UTC, Egmont Koblinger
Details
Type1 first, TTF later - printing is okay (35.86 KB, text/plain)
2006-03-09 12:22 UTC, Egmont Koblinger
Details
TTF first, Type1 later - printing is buggy (35.87 KB, text/plain)
2006-03-09 12:28 UTC, Egmont Koblinger
Details

Description Egmont Koblinger 2006-03-09 12:09:54 UTC
See the attached screenshot, this is how both the print preview and the
actual printout on paper look like. All the characters are consistently
replaced with another one.

This is a gedit with default settings (the font it tries to use for the body
is "Monospace 9"), but I've heard about exactly the same printing problem in
evolution.

I don't know if gnome-print is the place of the bug, it was just a guess, but
I have no better idea. I have gnome 2.12.1, libgnomeprint and libgnomeprintui
are also numbered as 2.12.1.

Here's what I managed to debug:

With (nearly?) any other font instead of the default Monospace the characters
are okay in print (but of course not fixed-width).

I have X.Org 7.0 and its fonts are installed to /usr/share/fonts. Hence there
are several subdirectories here, including /usr/share/fonts/TTF and
/usr/share/fonts/Type1. Neither of these two directories are mentioned in my
xorg.conf, but it did't seem to matter.

If I remove one of these two directories (either TTF or Type1), or even both
of them, and run "fc-cache -f" as root, then printing (as well as the preview)
is perfect in gedit (as well as in evolution, as reported by that user). The
bug only appears if both of these two directories are present there and
mentioned in fonts.cache-[12].

(I've tested this whole issue with fontconfig 2.2.3, 2.3.2 and 2.3.94, they
do not make any difference.)

However, if both the TTF and Type1 directories are present there, then there's
still a 50% change that you won't hit this bug. Up to now fontconfig has
scanned the directories in random (filesystem) order. (See the thread at
http://lists.freedesktop.org/archives/fontconfig/2006-March/002154.html
for a short discussion about it).

On my machine, this random order happens to be TTF prior to Type1. So
fonts.cache-1 has TTF first and Type1 later. In this case printing is buggy.
However if I swap these two entries in fonts.cache-1 (with fontconfig<=2.3.2)
then printing is okay.

According to fonts.{dir,scale} these two directories both implement
-b&h-luxi mono-[blahblah...] fonts in different formats. I'll attach strace
output which shows that in the buggy case fonts from both directories are
being opened. Hence I have a strong feeling that some piece of printing
software just cannot decide which one of the two implementations of the same
font to use and mixes them. Maybe it takes the font shape from one of them
and the encoding table from the other, or something similar, which leads to
this bug.

If and only if printing is buggy in gedit, it also prints many lines like
these ones to stderr:

(gedit:2642): GnomePrint-CRITICAL **: gnome_rfont_get_glyph_stdadvance: assertion `glyph < GRF_NUM_GLYPHS (rfont)' failed

(gedit:2642): GnomePrint-CRITICAL **: gnome_rfont_get_glyph_stdbbox: assertion `glyph < GRF_NUM_GLYPHS (rfont)' failed

(gedit:2642): GnomePrint-CRITICAL **: gnome_rfont_render_glyph_rgb8: assertion `glyph < GRF_NUM_GLYPHS (rfont)' failed
Comment 1 Egmont Koblinger 2006-03-09 12:10:34 UTC
Created attachment 60964 [details]
Screenshot
Comment 2 Egmont Koblinger 2006-03-09 12:19:13 UTC
Created attachment 60965 [details]
none of Type1 and TTF is present - printing is okay

None of Type1 and TTF is present in fonts.cache. Printing is okay.
I don't know where gedit takes the fonts from, but I don't really care
as long as it works correctly :)
Comment 3 Egmont Koblinger 2006-03-09 12:20:16 UTC
Created attachment 60966 [details]
only TTF - printing is okay

TTF is present in fonts.cache-1 but Type1 isn't. Gedit opens a font from the
TTF directory. Printing is okay.
Comment 4 Egmont Koblinger 2006-03-09 12:21:02 UTC
Created attachment 60967 [details]
only Type1 - printing is okay

Only Type1 is present in fonts.cache-1, TTF isn't. Gedit opens a font from the
Type1 directory. Printing is okay.
Comment 5 Egmont Koblinger 2006-03-09 12:22:51 UTC
Created attachment 60968 [details]
Type1 first, TTF later - printing is okay

fonts.cache has Type1 first and TTF later. Printing is okay. Gedit only opens a font from the TTF directory. (Seems that entries occuring later in fonts.cache have precedence over earlier ones?)
Comment 6 Egmont Koblinger 2006-03-09 12:28:07 UTC
Created attachment 60969 [details]
TTF first, Type1 later - printing is buggy

fonts.cache-1 has TTF first and Type1 later. Printing is buggy as shown on the screenshot. Gedit opens TTF/luximr.ttf which belongs to
-b&h-luxi mono-medium-r-normal--0-0-0-0-c-0-*-*
and Type1/l047013t.pfa which belongs to
-b&h-luxi mono-medium-r-normal--0-0-0-0-m-0-*-*
Comment 7 Egmont Koblinger 2006-04-14 16:16:22 UTC
Update:

Now I'm running Gnome 2.14.1 and fontconfig 2.3.94 with the sorting patch:
http://lists.freedesktop.org/archives/fontconfig/2006-March/002167.html
It is still buggy exactly as discussed above.

As a terrible workaround, I modified the sorting patch to do reverse sorting
(just a minus sign prepended to the return value in cmpstringp()) and now it's
okay for me but still it is a serious printing problem in Gnome.
Comment 8 Gour 2006-07-11 13:02:33 UTC
(In reply to comment #7)

Hi!

> Update:
> 
> Now I'm running Gnome 2.14.1 and fontconfig 2.3.94 with the sorting patch:
> http://lists.freedesktop.org/archives/fontconfig/2006-March/002167.html
> It is still buggy exactly as discussed above.

I'm on Gnome 2.14.2 and I experience the problem with Evolution-2.6.2 (gedit is OK) - see e.g. http://dev.atmarama.org/Screenshot.png.

I have fontconfig-2.3.2-r1 emerged and libgnomeprint-2.12.1.

> 
> As a terrible workaround, I modified the sorting patch to do reverse sorting
> (just a minus sign prepended to the return value in cmpstringp()) and now it's
> okay for me but still it is a serious printing problem in Gnome.

I didn't try any workaround, but this bug renders Evolution totally (almost, cause it does not happen with every message) useless.

Pls. fix it!

Sincerely,
Gour
 

Comment 9 Kjartan Maraas 2007-02-07 15:58:32 UTC
I can't reproduce this here on Fedora Core. Do you still experience this problem?
Comment 10 Gour 2007-02-07 16:24:17 UTC
(In reply to comment #9)
> I can't reproduce this here on Fedora Core. Do you still experience this
> problem?
> 

Well, I'm not using Evolution any longer - switched to Claws-mail and there everything is fine, ie. not just printing ;)

Sincerely,
Gour
Comment 11 Kjartan Maraas 2009-05-17 20:02:11 UTC
Closing. gnome-print has been replaced by printing functionality in gtk+