Bug 691544 - Font selection for display is not understood
Summary: Font selection for display is not understood
Status: RESOLVED INVALID
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Font API (show other bugs)
Version: 8.71
Hardware: PC Linux
: P4 normal
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-10 10:15 UTC by Graham Freeman
Modified: 2010-08-10 15:41 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Freeman 2010-08-10 10:15:31 UTC
I do not understand how fonts are selected to display Ghostscript output under
Linux. I have two Linux machines with Ghostscript 8.71. Only one has
urwfonts-1.41 installed in /usr/share/fonts/. If I run this code on the machines

%!
/Times-Roman findfont 20 scalefont setfont
100 100 moveto (\256) show showpage

they display a different character. The machine with the URW fonts gives this
behaviour:

$ gs
GPL Ghostscript 8.71 (2010-02-10)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>/Times-Roman findfont 20 scalefont setfont
100 100 moveto (\256) show showpage
Can't find (or can't open) font file /usr/share/ghostscript/8.71/Resource/Font/NimbusRomNo9L-Regu.
Can't find (or can't open) font file NimbusRomNo9L-Regu.
Can't find (or can't open) font file /usr/share/ghostscript/8.71/Resource/Font/NimbusRomNo9L-Regu.
Can't find (or can't open) font file NimbusRomNo9L-Regu.
Querying operating system for font files...
Loading NimbusRomNo9L-Regu font from /usr/share/fonts/urwfonts-1.41/NimbusRomNo9L-Regu.ttf... 3540056 1805029 5486792 4140273 1 done.

and uses ISOLatin1Encoding by default and draws the registered symnbol, whereas
the machine without the URW font uses StandardEncoding and displays the fi
ligature and gives this response:

$ gs
GPL Ghostscript 8.71 (2010-02-10)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>/Times-Roman findfont 20 scalefont setfont
100 100 moveto (\256) show showpage
Can't find (or can't open) font file /usr/share/ghostscript/8.71/Resource/Font/NimbusRomNo9L-Regu.
Can't find (or can't open) font file NimbusRomNo9L-Regu.
Can't find (or can't open) font file /usr/share/ghostscript/8.71/Resource/Font/NimbusRomNo9L-Regu.
Can't find (or can't open) font file NimbusRomNo9L-Regu.
Querying operating system for font files...
Loading NimbusRomNo9L-Regu font from /usr/share/fonts/default/Type1/n021003l.pfb... 2635160 1145514 3342416 1659459 1 done.

Printing from both machines uses the StandardEncoding and is identical. 

So the question is, what do I need to do to get ghostscript to take the default
font instead of the URW TTF version?
Comment 1 Ray Johnston 2010-08-10 15:41:53 UTC
Please see doc/Use.htm#Font_lookup

In particular, the alias mapping from Times-Roman to an actual fontname and
the mapping from the fontname to a file is performed by the contents of
Fontmap.

Another complication depends on how ghostscript was configured when it was
built. Usually on linux, by default, Ghostscript uses the 'fontconfig' to
"help" find fonts. To build without fontconfig use:

   configure --disable-fontconfig ; make

Since this isn't a real bug, and since this is not the forum for help, I am
closing this bug.