GNOME Bugzilla – Bug 334011
printing replaces all characters with different ones
Last modified: 2009-05-17 20:02:11 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
Created attachment 60964 [details] Screenshot
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 :)
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.
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.
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?)
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-*-*
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.
(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
I can't reproduce this here on Fedora Core. Do you still experience this problem?
(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
Closing. gnome-print has been replaced by printing functionality in gtk+