Create a directory to contain the font files
% mkdir -p /usr/local/share/fonts/type1
% cd /usr/local/share/fonts/type1
Place the .pfa, .pfb and .afm files here
One might want to keep readme files, and other documentation
for the fonts here also
% cp /cdrom/fonts/atm/showboat/showboat.pfb .
% cp /cdrom/fonts/atm/showboat/showboat.afm .
Maintain an index to cross reference the fonts
% echo showboat - InfoMagic CICA, Dec 1994, /fonts/atm/showboat >>INDEX
Make the font accessible to X11
% cd /usr/X11R6/lib/X11/fonts/Type1
% ln -s /usr/local/share/fonts/type1/showboat.pfb .
Edit fonts.dir and fonts.scale, adding the line describing the font
and incrementing the number of fonts which is found on the first line.
% ex fonts.dir
:1p
25
:1c
26
.
:$a
showboat.pfb -type1-showboat-medium-r-normal-decorative-0-0-0-0-p-0-iso8859-1
.
:wq
fonts.scale seems to be identical to fonts.dir...
% cp fonts.dir fonts.scale
Tell X11 that things have changed
% xset fp rehash
Examine the new font
% xfontsel -pattern -type1-*
Put the font in Ghostscript's font directory
% cd /usr/local/share/ghostscript/fonts
% ln -s /usr/local/share/fonts/type1/showboat.pfb .
Edit Fontmap so Ghostscript knows about the font
% cd /usr/local/share/ghostscript/4.01
% ex Fontmap
:$a
/Showboat (showboat.pfb) ; % From CICA /fonts/atm/showboat
.
:wq
Use Ghostscript to examine the font
% gs prfont.ps
Aladdin Ghostscript 4.01 (1996-7-10)
Copyright (C) 1996 Aladdin Enterprises, Menlo Park, CA. All rights
reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading Times-Roman font from /usr/local/share/ghostscript/fonts/tir_____.pfb...
/1899520 581354 1300084 13826 0 done.
GS>Showboat DoFont
Loading Showboat font from /usr/local/share/ghostscript/fonts/showboat.pfb...
1939688 565415 1300084 16901 0 done.
>>showpage, press <return> to continue<<
>>showpage, press <return> to continue<<
>>showpage, press <return> to continue<<
GS>quit
Many .afm files are in Mac format... ^M delimited lines
We need to convert them to UNIX(R) style ^J delimited lines
% cd /tmp
% cat /usr/local/share/fonts/type1/showboat.afm |
tr '015' '012' >showboat.afm
Now create the groff font file
% cd /usr/share/groff_font/devps
% /tmp/afmtodit.pl -d DESC -e text.enc /tmp/showboat.afm generate/textmap SHOWBOAT
Create the .pfa font file
% pfbtops /usr/local/share/fonts/type1/showboat.pfb >showboat.pfa
当然,如果.pfa 已经可用,只需使用符号链接来引用它。
Get the internal font name
% fgrep internalname SHOWBOAT
internalname Showboat
Tell groff that the font must be downloaded
% ex download
:$a
Showboat showboat.pfa
.
:wq
测试字体:
% cd /tmp
% cat >example.t <<EOF
.sp 5
.ps 16
This is an example of the Showboat font:
.br
.ps 48
.vs (n(.s+2)p
.sp
.ft SHOWBOAT
ABCDEFGHI
.br
JKLMNOPQR
.br
STUVWXYZ
.sp
.ps 16
.vs (n(.s+2)p
.fp 5 SHOWBOAT
.ft R
To use it for the first letter of a paragraph, it will look like:
.sp 50p
s(48f5Hs0fRere is the first sentence of a paragraph that uses the
showboat font as its first letter.
Additional vertical space must be used to allow room for the larger
letter.
EOF
% groff -Tps example.t >example.ps
To use ghostscript/ghostview
% ghostview example.ps
To print it
% lpr -Ppostscript example.ps
% gs -dNODISPLAY -- ttf2pf.ps 3of9.ttf
Aladdin Ghostscript 5.10 (1997-11-23)
Copyright (C) 1997 Aladdin Enterprises, Menlo Park, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Converting 3of9.ttf to 3of9.pfa and 3of9.afm.
如果你希望将转换后的字体存储在 A.pfa 和 B.afm 中,请使用以下命令:
% gs -dNODISPLAY -- ttf2pf.ps 3of9.ttf A B
Aladdin Ghostscript 5.10 (1997-11-23)
Copyright (C) 1997 Aladdin Enterprises, Menlo Park, CA. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Converting 3of9.ttf to A.pfa and B.afm.