Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding Fonts to Ghostscript

147 views
Skip to first unread message

Paul R Schmidtbleicher

unread,
Aug 3, 2022, 8:18:59 PM8/3/22
to
In "/usr/share/ghostscript/9.54.0/Resource/Init/" are two Fontmap files.
One is "Fontmap" 109B(ytes) I assume
The other is "Fontmap.GS" which can be modified by utilities like "Kate"

I modified "Fontmap.GS" for 4 "alias" fonts pointing to fonts in a
directory included.

% Aliases

/Times-BoldItalic (/usr/share/PSFONTS/TNRBI.PFB) ;
/Times-Bold (/usr/share/PSFONTS/TNRB.PFB) ;
/Times-Italic (/usr/share/PSFONTS/TNRI.PFB) ;
/Times-Roman (/usr/share/PSFONTS/TNR.PFB) ;

However, it makes no difference when seeking to print a "PS" postscript
file. The nimbus font is chosen

What step am I missing to get Ghostscript to recognize the changes to the
"Fontmap.GS" file.

Jeffrey H. Coffield

unread,
Aug 4, 2022, 11:51:01 AM8/4/22
to
I assume you changed the existing definitions of Times and not added
these lines to the front of the file.

What is displayed if you enter

/Times-Roman findfont

into Ghostscript?

Jeff

Paul R Schmidtbleicher

unread,
Aug 4, 2022, 2:25:25 PM8/4/22
to
This is what I get

GS>/Times-Roman findfont
Loading NimbusRoman-Regular font from /usr/share/ghostscript/9.54.0/
Resource/Font/NimbusRoman-Regular... 4481928 3126030 2005312 686036 1
done.

It still loads a wrong font.

Paul R Schmidtbleicher

unread,
Aug 4, 2022, 3:24:09 PM8/4/22
to
My assumption was that editing the the Fontmap.GS file (as directed in the
file itself - which I accurately followed) would mean that GS would read
it at initialization and incorporate the changes. With me was
substituting for the "generic" nimbus fonts that GS uses with the right
fonts from the original application producing the postscript (*.ps) output
file. The (*.ps) postscript file output reads the two fonts used as
"Times-Roman" and "Times-Bold." GS substitutes (dotmatrix looking) nimbus
fonts.

Now, if I add "-c loadallfonts" to the command line it runs several
screens over 2-3 minutes of "loading cant find ....." BUT finally does get
to the right fonts. My goal was to circumvent this wasted activity and
get immediately to the right fonts and print it out.

Interestingly, GV Ghostview loads the right screen on my monitor with the
right fonts, but on printing (from GV) its back to the dot-matrix looking
nimbus fonts.

Thanks for any suggestions,
Paul

Jeffrey H. Coffield

unread,
Aug 4, 2022, 3:35:31 PM8/4/22
to
Just to confirm...

There isn't any definition of /Times-Roman in the Fontmap.GS AFTER the
lines you changed/added?

Jeff

Paul R Schmidtbleicher

unread,
Aug 4, 2022, 4:02:05 PM8/4/22
to
Before the original Alias "Times" fonts I put % at the beginning
of each line
I assumed this means it is taken as "text" like the instructions

I then rewrote the 4 lines
/Times-Roman (/usr/share/PSFONTS/TNR.PFB) ;
etc. for the other 3 "Times" fonts
as the instructions said.

Doing a "Find" on Fontmap.GS shows only the
blocked originals
% /Times-Roman ......
and my Changes
/Times-Roman (/usr/share/PSFONTS/TNR.PFB) ;

No other.
Paul

Jeffrey H. Coffield

unread,
Aug 4, 2022, 4:36:59 PM8/4/22
to
Okay,

My next guess is that Times-Roman, being one of the 13 base fonts, is
loaded by default and the Fontmap.GS is only used when it needs a font
it doesn't already know about. This definition appears to be overridden
by the loadallfonts command.

What if you changed the name to /Times-RomanX? What happens then?

Probably not a final solution but a good test.

You could also try replacing the file Nimbus-Roman* files with your own.

Jeff

Paul R Schmidtbleicher

unread,
Aug 4, 2022, 6:56:18 PM8/4/22
to
I have had some time to "play." Here is what I found:
1. The font always substituted is "NimbusMonoPS-Regular."
2. In the Fontmap.GS "Aliases" this is ONLY associated with "Courier"
Font.
3. I then made my new substitutions to "Courier" in a new (TEST)
Fontmap.GS file I called MyFontmap.GS and included in the command line "-
sFONTMAP=/usr/share/ghostscript/MyFontmap.GS
4. The command worked - GS read the MyFontmap.GS. It also reported Courier
was replaced by TimesNewRoman in the output. And the output was right!

5. Now, why, when I can read the Applications print output "file.ps" does
it read for every line "Times-Roman," while GS sees the Font as Currier???
6. My first guess is that there must be numbers being read and not the
text in the postscript file. (???) And since maybe old DOS numbers have
changed???
7. The application is an old DOS program I run under DOSBOX called
GeoWorks. It was GEOS for Commodore, Then GEOWORKS for PC. It will print
to a Postscript (Capable) Printer. I use this application weekly. First
under and OS/2 Ghostscript and now under OpenSuse Tumbleweed Ghostscript.

In any case, it looks like the modified MyFontmap.GS file is being read.
In my case, when I changed the /Times-Roman aliases which made no
difference when GC was interpreting a Courier font.

So thanks for the help, Jeff - Not sure where I go from here. (Maybe put
up with all the time and output that "loadallfonts" does)

Paul
0 new messages