Discussion:
[tex-k] How Does One Create pk Files From A PostScript Font?
Jay F Shachter
2012-06-07 15:10:05 UTC
Permalink
I have some PostScript definitions of fonts that I would like to use
in TeX. I created the necessary tfm file by running afm2tfm on an afm
file that I had earlier created from the font definitions by using
$GS_HOME/lib/printafm.ps (part of the GhostScript distribution; I
observe, parenthetically, that the printafm procedure choked until I
modified the font definition by adding an otherwise unnecessary
FontName entry to the font dictionary).

At this point, I can, presumably (I have not tried it), create dvi
files using TeX. The remaining unsolved problem is creating pk files
so that my TeX output can be rendered. The (misnamed) ps2pk program
requires a .pfb or .psa file. I have neither, only a .ps file
containing a dictionary definition indexed by the keys /FontName,
/FontType, /FontMatrix, /FontBBox, /PaintType, /FontInfo (which is
itself a dictionary), /Encoding, /Metrics, /CharStrings, and
/BuildChar.

Of course, I understand that the name of a file means nothing. I can
certainly copy or rename the .ps file to a .pfa file. The more
substantive problem is that ps2pk seems to insist on a Type 1 font.
Thus:

$ cp OldJaffa.ps OldJaffa.pfa
$ ps2pk OldJaffa
psfile = ./OldJaffa.pfa
afmfile = ./OldJaffa.afm
basename of OldJaffa = OldJaffa
basename of ./OldJaffa.pfa = OldJaffa.pfa
Type1OpenScalable error (result: -2) on ./OldJaffa.pfa

My PostScript files define Type 3 fonts, not Type 1 fonts. How do I
use them with TeX? Thank you in advance for any and all replies. You
may reach me using any of the means indicated below.


Jay F. Shachter
6424 N Whipple St
Chicago IL 60645-4111
(1-773)7613784 landline
(1-410)9964737 GoogleVoice
JayShachter on Skype
FedyaDolohov on AIM
jay at m5.chicago.il.us
Reinhard Kotucha
2012-06-08 00:27:09 UTC
Permalink
Post by Jay F Shachter
I have some PostScript definitions of fonts that I would like to use
in TeX. I created the necessary tfm file by running afm2tfm on an afm
file that I had earlier created from the font definitions by using
$GS_HOME/lib/printafm.ps (part of the GhostScript distribution; I
observe, parenthetically, that the printafm procedure choked until I
modified the font definition by adding an otherwise unnecessary
FontName entry to the font dictionary).
At this point, I can, presumably (I have not tried it), create dvi
files using TeX. The remaining unsolved problem is creating pk files
so that my TeX output can be rendered. The (misnamed) ps2pk program
requires a .pfb or .psa file. I have neither, only a .ps file
containing a dictionary definition indexed by the keys /FontName,
/FontType, /FontMatrix, /FontBBox, /PaintType, /FontInfo (which is
itself a dictionary), /Encoding, /Metrics, /CharStrings, and
/BuildChar.
Of course, I understand that the name of a file means nothing. I can
certainly copy or rename the .ps file to a .pfa file. The more
substantive problem is that ps2pk seems to insist on a Type 1 font.
$ cp OldJaffa.ps OldJaffa.pfa
$ ps2pk OldJaffa
psfile = ./OldJaffa.pfa
afmfile = ./OldJaffa.afm
basename of OldJaffa = OldJaffa
basename of ./OldJaffa.pfa = OldJaffa.pfa
Type1OpenScalable error (result: -2) on ./OldJaffa.pfa
My PostScript files define Type 3 fonts, not Type 1 fonts. How do I
use them with TeX? Thank you in advance for any and all replies. You
may reach me using any of the means indicated below.
Trying to create .pk fonts is a step into the wrong direction, IMO.
It makes more sense to create a Type 1 font instead. In order to find
out the best approach, I need more details about your font. Are there
outlines already or are glyphs described with arbitrary PostScript code?

Regards,
Reinhard
--
----------------------------------------------------------------------------
Reinhard Kotucha Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------
Paul Vojta
2012-06-08 00:36:06 UTC
Permalink
Post by Reinhard Kotucha
Post by Jay F Shachter
I have some PostScript definitions of fonts that I would like to use
in TeX. I created the necessary tfm file by running afm2tfm on an afm
file that I had earlier created from the font definitions by using
$GS_HOME/lib/printafm.ps (part of the GhostScript distribution; I
observe, parenthetically, that the printafm procedure choked until I
modified the font definition by adding an otherwise unnecessary
FontName entry to the font dictionary).
At this point, I can, presumably (I have not tried it), create dvi
files using TeX. The remaining unsolved problem is creating pk files
so that my TeX output can be rendered. The (misnamed) ps2pk program
requires a .pfb or .psa file. I have neither, only a .ps file
containing a dictionary definition indexed by the keys /FontName,
/FontType, /FontMatrix, /FontBBox, /PaintType, /FontInfo (which is
itself a dictionary), /Encoding, /Metrics, /CharStrings, and
/BuildChar.
Of course, I understand that the name of a file means nothing. I can
certainly copy or rename the .ps file to a .pfa file. The more
substantive problem is that ps2pk seems to insist on a Type 1 font.
$ cp OldJaffa.ps OldJaffa.pfa
$ ps2pk OldJaffa
psfile = ./OldJaffa.pfa
afmfile = ./OldJaffa.afm
basename of OldJaffa = OldJaffa
basename of ./OldJaffa.pfa = OldJaffa.pfa
Type1OpenScalable error (result: -2) on ./OldJaffa.pfa
My PostScript files define Type 3 fonts, not Type 1 fonts. How do I
use them with TeX? Thank you in advance for any and all replies. You
may reach me using any of the means indicated below.
Trying to create .pk fonts is a step into the wrong direction, IMO.
It makes more sense to create a Type 1 font instead. In order to find
out the best approach, I need more details about your font. Are there
outlines already or are glyphs described with arbitrary PostScript code?
Regards,
Reinhard
Or: Have you tried gsftopk?

--Paul Vojta, vojta at math.berkeley.edu
Jay F Shachter
2012-06-08 22:16:43 UTC
Permalink
Post by Reinhard Kotucha
Trying to create .pk fonts is a step into the wrong direction, IMO.
It makes more sense to create a Type 1 font instead. In order to find
out the best approach, I need more details about your font. Are there
outlines already or are glyphs described with arbitrary PostScript code?
The glyphs are described with PostScript code. The only PostScript
drawing operators used are lineto, rlineto, curveto, and rcurveto,
except for the very end, where there is either a fill or a stroke,
depending on the value of /PaintType, which is extracted and consulted
(thus, regardless of whether you set /PaintType to 0 or 1, you are
telling the truth).

As Paul Vojta suggested in a subsequent reply, the command of which I
needed to be made aware was gsftopk. The command

gsftopk --mapline='OldJaffa OldJaffa <OldJaffa.ps' OldJaffa 600

produced OldJaffa.600pk and, mutatis mutandis, all the other pk files
I needed. After that all I had to do was move the pk files to the
appropriate directory, move the tfm file (which I already had) to the
appropriate directory, and run mktexlsr. Many thanks to this mailing
list for giving me the information I needed.


Jay F. Shachter
6424 N Whipple St
Chicago IL 60645-4111
(1-773)7613784 landline
(1-410)9964737 GoogleVoice
jay at m5.chicago.il.us
http://m5.chicago.il.us

"Quidquid latine dictum sit, altum videtur"

Loading...