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 161579 - pango_create_layout scrambles fonts
pango_create_layout scrambles fonts
Status: RESOLVED DUPLICATE of bug 159573
Product: gnome-print
Classification: Deprecated
Component: PDF backend
CVS
Other Mac OS
: Normal major
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2004-12-17 22:55 UTC by Marc Culler
Modified: 2005-03-12 21:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample sheet (1.88 KB, application/x-gnumeric)
2004-12-20 20:27 UTC, Marc Culler
Details
output of sample sheet with new printing code (100.87 KB, application/pdf)
2004-12-20 20:28 UTC, Marc Culler
Details
output of sample sheet with old printing code (98.72 KB, application/pdf)
2004-12-20 20:29 UTC, Marc Culler
Details

Description Marc Culler 2004-12-17 22:55:31 UTC
I compiled gnumeric 1.4.1 on Apple OS X 1.3 with pango-1.7.  The print preview and printing worked,
but the fonts were scrambled.  Basic characters were replaced with extended-latin accented characters.
For example the letter A (0x0041) was replaced by an accented R (0x0154) and the numeral 1 (0x0031) 
was replaced by an accented I (0x00cc).  This happened both in the preview and on the printer, but not 
in the spreadsheet display.  I commented out these two lines in gnumeric-config.h:
/* #define HAVE_GNOME_PRINT_PANGO_CREATE_LAYOUT 1 */
/* #define HAVE_PANGO_LAYOUT_SET_ELLIPSIZE 1 */
and recompiled.  Then everything was fine.
Comment 1 Morten Welinder 2004-12-19 21:37:06 UTC
This feels like a libgnomeprint bug.  What version are you using?
Also, please provide a sample sheet.

(Your workaround has lots of other problems.  The code for that will disappear
when we branch.)
Comment 2 Marc Culler 2004-12-20 14:39:33 UTC
I am using libgnomeprint-2.8.2 and libgnomeprintui-2.8.2.

What would you like in the way of a sample sheet?  How about a pdf file?
Comment 3 Morten Welinder 2004-12-20 19:17:22 UTC
Sample sheet and the pdf/ps it produces would be great.

Notice, btw., that you can switch between new and old printing code simply
by setting USE_OLD_PRINT in the environment -- no recompilation needed.
Comment 4 Marc Culler 2004-12-20 20:27:03 UTC
Created attachment 35057 [details]
sample sheet
Comment 5 Marc Culler 2004-12-20 20:28:15 UTC
Created attachment 35058 [details]
output of sample sheet with new printing code
Comment 6 Marc Culler 2004-12-20 20:29:54 UTC
Created attachment 35059 [details]
output of sample sheet with old printing code
Comment 7 Morten Welinder 2004-12-20 20:54:36 UTC
Ok, confirming that the pdf file looks screwed on my machine too.
Comment 8 Morten Welinder 2004-12-20 21:07:00 UTC
1. Is this font dependent?
2. Does it work for print preview?
Comment 9 Morten Welinder 2004-12-20 21:29:09 UTC
The generated pdf file (comment 5) generates sequential codes for characters
in the pdf file.  This does not happen for me, possibly because I don't have
the "Luxi Sans" font.

In the pdf file I notice...

/Type /Encoding
/BaseEncoding /MacRomanEncoding
/Differences [1
/Imacron /edotaccent /aring /gbreve /Uhungarumlaut /ecaron /lacute /Scaron
/ccedilla 
/cacute /iacute /idieresis /Racute /agrave /Idieresis /Rcaron /acircumflex /Iacute 
/Sacute /abreve /Igrave /atilde /Icircumflex /Scedilla /Idotaccent /Tcaron /aogonek 
/Lacute /Udieresis /Lcaron /Uacute /ccaron /Nacute /Ugrave /Ncaron /Ucircumflex
/dcaron 
/Gbreve /Uring /edieresis /eacute /Yacute /egrave /Zacute /ecircumflex /Zcaron
/Zdotaccent 
/Amacron /eogonek /Tcommaaccent /Ydieresis /Emacron /igrave /Iogonek /icircumflex 
/Kcommaaccent /Lcommaaccent /lcaron /Ncommaaccent /nacute /Omacron /ncaron ]

which, quite frankly, looks wrong.  It also happens to be the characters
displayed.

-->libgnomeprint.
Comment 10 Marc Culler 2004-12-20 22:44:19 UTC
It looks the same in preview as it does when it prints.

Yes, it is font dependent!  I should have noticed that before.

In fact, the only fonts that cause trouble are Luxi Mono, Luxi Sans and Luxi Serif.  Also, these are the 
only fonts that come with the Apple X server which are listed as available in the adobe-standard 
encoding.  (None of my ghostscript fonts are listed with that encoding.)  These fonts are supplied in 
both TTF and Type1 formats (/usr/X11R6/lib/X11/fonts/TTF and /usr/X11R6/lib/X11/fonts/Type1).  
Here is a snippet from the Type1 fonts.dir file:

Type1/fonts.dir:l048013t.pfa -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-1
Type1/fonts.dir:l048013t.pfa -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-2
Type1/fonts.dir:l048013t.pfa -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-9
Type1/fonts.dir:l048013t.pfa -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-iso8859-15
Type1/fonts.dir:l048013t.pfa -b&h-Luxi Sans-medium-r-normal--0-0-0-0-p-0-adobe-standard

I don't know how these encodings differ.  Could it be that the pfa file is really is encoded in adobe-
standard but the new printing code assumes it iso8859 ???  The pfa files for the Luxi fonts contain 
custom encoding arrays, while the others just have:
/Encoding StandardEncoding def

Comment 11 Marc Culler 2004-12-21 04:59:13 UTC
I read up on the Luxi fonts.  It turns out that they are 16 bit fonts.  So I guess the bottom line is that the 
new print code doesn't handle 16 bit fonts correctly.  
Comment 12 Owen Taylor 2005-03-12 21:28:07 UTC

*** This bug has been marked as a duplicate of 159573 ***