Discussion:
Using URW Garamond fonts in GMT
Balaji Devaraju
2011-10-31 03:00:51 UTC
Permalink
Hello GMT-users,
I am trying to use the URW Garamond fonts that comes as non-free fonts with
the TeX Live distribution. I tried to follow the appendix G in the
Technical reference and Cookbook, but I am not sure what I am doing wrong.
So, here are the things that I did.
1. I wrote the CUSTOM_PS_font_info.d as follows and put it in the current
working directory

# CUSTOM_PS_font_info.d
# Testing Garamond font
# PS Encoding ISO-8859-1

GaramondNo8-Reg 0.805 0
GaramondNo8-Ita 0.805 0
GaramondNo8-Med 0.805 0

2. Then I copied the *.pfb font files into a folder called "fonts" and put
that in the current working directory

3. Then I ran the script attached to this e-mail, which results in the
following output
$ sh jobgaramond.sh
gmtset(GMT_gmtset): Warning: Length unit g not supported - revert to
default unit [point]
gmtset(GMT_gmtset): Warning: GaramondNo8-Re not a valid number and may not
be decoded properly.
gmtset(GMT_gmtset): Representation of font size not recognised. Using
default.
gmtset(GMT_gmtset): Warning: Length unit g not supported - revert to
default unit [point]
gmtset(GMT_gmtset): Warning: GaramondNo8-Re not a valid number and may not
be decoded properly.
gmtset(GMT_gmtset): Representation of font size not recognised. Using
default.
gmtset(GMT_gmtset): Warning: Length unit g not supported - revert to
default unit [point]
gmtset(GMT_gmtset): Warning: GaramondNo8-Re not a valid number and may not
be decoded properly.
gmtset(GMT_gmtset): Representation of font size not recognised. Using
default.
gmtset(GMT_gmtset): Warning: Length unit g not supported - revert to
default unit [point]
gmtset(GMT_gmtset): Warning: GaramondNo8-Re not a valid number and may not
be decoded properly.
gmtset(GMT_gmtset): Representation of font size not recognised. Using
default.

As it is obvious from the output the default Helvetica font is used. Any
help in solving this problem is greatly appreciated.

Cheers,
Balaji

To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Florian Wobbe
2011-10-31 05:02:38 UTC
Permalink
Post by Balaji Devaraju
I am trying to use the URW Garamond fonts that comes as non-free fonts with
the TeX Live distribution. I tried to follow the appendix G in the
Technical reference and Cookbook, but I am not sure what I am doing wrong.
So, here are the things that I did.
Hi Balaji,

to get you on the right track:

1) In your script, there is a typo in the filename: CUSTOM_font_info.d

2) You might have to quote GaramondNo8-Reg: gmtset FONT "GaramondNo8-Reg"

3) GS might not know where the font is installed. So you might have to set FONTPATH.

I suggest you follow example 7.31 and especially the commented section that deals with PDF conversion (ps2raster). You have the option to embed the font (PDF only) or outline it.

Florian

To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Balaji Devaraju
2011-11-01 01:46:15 UTC
Permalink
Hi Florian,
Thanks for your suggestion! Once I do those changes, I don't get any errors
or anything, but the whole GMT system stops plotting. I don't get any more
PostScript out of the GMT commands. So, I had to completely reinstall the
GMT programs a couple of times.

Now when I use the second method of converting the fonts (if I underastand
it correctly!) into outline fonts and then using them for my plotting, then
I don't get any error messages, but the output doesn't change at all. I am
clueless as to what is happening! Did I do everything correct here?

Thanks in advance for the help!

Cheers,
D. Balaji
Post by Balaji Devaraju
Post by Balaji Devaraju
I am trying to use the URW Garamond fonts that comes as non-free fonts
with
Post by Balaji Devaraju
the TeX Live distribution. I tried to follow the appendix G in the
Technical reference and Cookbook, but I am not sure what I am doing
wrong.
Post by Balaji Devaraju
So, here are the things that I did.
Hi Balaji,
1) In your script, there is a typo in the filename: CUSTOM_font_info.d
2) You might have to quote GaramondNo8-Reg: gmtset FONT "GaramondNo8-Reg"
3) GS might not know where the font is installed. So you might have to set FONTPATH.
I suggest you follow example 7.31 and especially the commented section
that deals with PDF conversion (ps2raster). You have the option to embed
the font (PDF only) or outline it.
Florian
To unsubscribe, send the message "signoff gmt-help" to
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Florian Wobbe
2011-11-01 02:27:00 UTC
Permalink
Post by Balaji Devaraju
Now when I use the second method of converting the fonts (if I underastand
it correctly!) into outline fonts
This only means that ghostscript transfers the fonts into paths and fills [1].
Post by Balaji Devaraju
and then using them for my plotting, then
I don't get any error messages, but the output doesn't change at all. I am
clueless as to what is happening! Did I do everything correct here?
Because you removed the font definitions in the attached script. I'm a little puzzled since you have been there already. You still need to tell GMT to use the right font. This is important, otherwise GMT will just use the default Helvetica. You do this by setting up a CUSTOM_font_info.d file in the current directory and selecting the font with gmtset, e.g.:

cat << EOF > CUSTOM_font_info.d
GaramondNo8-Reg 0.805 0
GaramondNo8-Ita 0.805 0
GaramondNo8-Med 0.805 0
GaramondNo8-MedIta 0.805 0
EOF

gmtset FONT "GaramondNo8-Reg" PS_CHAR_ENCODING ISO-8859-1

Btw: if all of a sudden the fonts come out as Courier this means you got the FONTPATH wrong.

Florian

[1] http://www.printernational.org/outline-fonts.php

To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Balaji Devaraju
2011-11-01 11:45:23 UTC
Permalink
Hello Florian,
Thanks a lot for all the help! Everything works perfectly fine now, and the
results look great. Just one last clarification . So, no matter whether one
uses the outline of fonts or the other method, one has to provide the
CUSTOM_font_info.d file, right?

Cheers,
D. Balaji
Post by Balaji Devaraju
Post by Balaji Devaraju
Now when I use the second method of converting the fonts (if I
underastand
Post by Balaji Devaraju
it correctly!) into outline fonts
This only means that ghostscript transfers the fonts into paths and fills [1].
Post by Balaji Devaraju
and then using them for my plotting, then
I don't get any error messages, but the output doesn't change at all. I
am
Post by Balaji Devaraju
clueless as to what is happening! Did I do everything correct here?
Because you removed the font definitions in the attached script. I'm a
little puzzled since you have been there already. You still need to tell
GMT to use the right font. This is important, otherwise GMT will just use
the default Helvetica. You do this by setting up a CUSTOM_font_info.d file
cat << EOF > CUSTOM_font_info.d
GaramondNo8-Reg 0.805 0
GaramondNo8-Ita 0.805 0
GaramondNo8-Med 0.805 0
GaramondNo8-MedIta 0.805 0
EOF
gmtset FONT "GaramondNo8-Reg" PS_CHAR_ENCODING ISO-8859-1
Btw: if all of a sudden the fonts come out as Courier this means you got
the FONTPATH wrong.
Florian
[1] http://www.printernational.org/outline-fonts.php
To unsubscribe, send the message "signoff gmt-help" to
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Florian Wobbe
2011-11-01 11:56:43 UTC
Permalink
Post by Balaji Devaraju
Hello Florian,
Thanks a lot for all the help! Everything works perfectly fine now, and the
results look great. Just one last clarification . So, no matter whether one
uses the outline of fonts or the other method, one has to provide the
CUSTOM_font_info.d file, right?
Glad to hear that. In any case you need a CUSTOM_font_info.d in the local directory or modify the one in GMT's SHAREDIR. Regarding outlined vs. embedded fonts: I myself prefer PDF with embedded fonts because that is the most portable format. When you need PS then I would go for outlines. Another possibility that you have is to convert you binary PS fonts (.pfb) to .pfa format with pfbtopfa. You then can cat the .pfa files to the end of your GMT PS figure. But this works only for PS fonts not for OTF or TTF fonts.

Florian

To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Balaji Devaraju
2011-11-01 13:01:19 UTC
Permalink
Thanks again for the clarification. Now I think I can use most of the LaTeX
fonts for GMT!

Cheers,
Balaji
Post by Florian Wobbe
Post by Balaji Devaraju
Hello Florian,
Thanks a lot for all the help! Everything works perfectly fine now, and
the
Post by Balaji Devaraju
results look great. Just one last clarification . So, no matter whether
one
Post by Balaji Devaraju
uses the outline of fonts or the other method, one has to provide the
CUSTOM_font_info.d file, right?
Glad to hear that. In any case you need a CUSTOM_font_info.d in the local
directory or modify the one in GMT's SHAREDIR. Regarding outlined vs.
embedded fonts: I myself prefer PDF with embedded fonts because that is the
most portable format. When you need PS then I would go for outlines.
Another possibility that you have is to convert you binary PS fonts (.pfb)
to .pfa format with pfbtopfa. You then can cat the .pfa files to the end of
your GMT PS figure. But this works only for PS fonts not for OTF or TTF
fonts.
Florian
To unsubscribe, send the message "signoff gmt-help" to
To unsubscribe, send the message "signoff gmt-help" to ***@lists.hawaii.edu
Loading...