The translation is temporarily closed for contributions due to maintenance, please come back later.

Source string Read only

(itstool) path: informalexample/screen
Context English State
References: <citerefentry vendor="xfree86"><refentrytitle>xfontsel</refentrytitle><manvolnum>1</manvolnum></citerefentry>, <citerefentry vendor="xfree86"><refentrytitle>xset</refentrytitle><manvolnum>1</manvolnum></citerefentry>, <citetitle>The X Windows System in a Nutshell</citetitle>, <link xlink:href="http://www.ora.com/">O'Reilly &amp; Associates</link>.
Using Type 1 Fonts with Ghostscript
<application>Ghostscript</application> references a font via its <filename>Fontmap</filename>. This must be modified in a similar way to the <application>X11</application> <filename>fonts.dir</filename>. <application>Ghostscript</application> can use either the <filename>.pfa</filename> or the <filename>.pfb</filename> format fonts. Using the font from the previous example, here is how to use it with <application>Ghostscript</application>:
<lineannotation>Put the font in Ghostscript's font directory</lineannotation>
<prompt>%</prompt> <userinput>cd /usr/local/share/ghostscript/fonts</userinput>
<prompt>%</prompt> <userinput>ln -s /usr/local/share/fonts/type1/showboat.pfb .</userinput>

<lineannotation>Edit Fontmap so Ghostscript knows about the font</lineannotation>
<prompt>%</prompt> <userinput>cd /usr/local/share/ghostscript/4.01</userinput>
<prompt>%</prompt> <userinput>ex Fontmap
:$a
/Showboat (showboat.pfb) ; % From CICA /fonts/atm/showboat
.
:wq</userinput>

<lineannotation>Use Ghostscript to examine the font</lineannotation>
<prompt>%</prompt> <userinput>gs prfont.ps</userinput>
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&gt;<userinput>Showboat DoFont</userinput>
Loading Showboat font from /usr/local/share/ghostscript/fonts/showboat.pfb...
1939688 565415 1300084 16901 0 done.
&gt;&gt;showpage, press &lt;return&gt; to continue&lt;&lt;
&gt;&gt;showpage, press &lt;return&gt; to continue&lt;&lt;
&gt;&gt;showpage, press &lt;return&gt; to continue&lt;&lt;
GS&gt;<userinput>quit</userinput>
References: <filename>fonts.txt</filename> in the <application>Ghostscript 4.01</application> distribution
Using Type 1 Fonts with Groff
Now that the new font can be used by both <application>X11</application> and <application>Ghostscript</application>, how can one use the new font with <application>groff</application>? First of all, since we are dealing with type 1 <trademark class="registered">PostScript</trademark> fonts, the <application>groff</application> device that is applicable is the <emphasis>ps</emphasis> device. A font file must be created for each font that <application>groff</application> can use. A <application>groff</application> font name is just a file in <filename>/usr/share/groff_font/devps</filename>. With our example, the font file could be <filename>/usr/share/groff_font/devps/SHOWBOAT</filename>. The file must be created using tools provided by <application>groff</application>.
The first tool is <command>afmtodit</command>. This is not normally installed, so it must be retrieved from the source distribution. I found I had to change the first line of the file, so I did:
<prompt>%</prompt> <userinput>cp /usr/src/gnu/usr.bin/groff/afmtodit/afmtodit.pl /tmp</userinput>
<prompt>%</prompt> <userinput>ex /tmp/afmtodit.pl
:1c
#!/usr/bin/perl -P-
.
:wq</userinput>
This tool will create the <application>groff</application> font file from the metrics file (<filename>.afm</filename> suffix.) Continuing with our example:
<lineannotation>Many .afm files are in Mac format… ^M delimited lines
We need to convert them to <trademark class="registered">UNIX</trademark> style ^J delimited lines</lineannotation>
<prompt>%</prompt> <userinput>cd /tmp</userinput>
<prompt>%</prompt> <userinput>cat /usr/local/share/fonts/type1/showboat.afm |
tr '\015' '\012' &gt;showboat.afm</userinput>

<lineannotation>Now create the groff font file</lineannotation>
<prompt>%</prompt> <userinput>cd /usr/share/groff_font/devps</userinput>
<prompt>%</prompt> <userinput>/tmp/afmtodit.pl -d DESC -e text.enc /tmp/showboat.afm generate/textmap SHOWBOAT</userinput>
The font can now be referenced with the name SHOWBOAT.
If <application>Ghostscript</application> is used to drive the printers on the system, then nothing more needs to be done. However, if true <trademark class="registered">PostScript</trademark> printers are used, then the font must be downloaded to the printer in order for the font to be used (unless the printer happens to have the showboat font built in or on an accessible font disk.) The final step is to create a downloadable font. The <command>pfbtops</command> tool is used to create the <filename>.pfa</filename> format of the font, and <filename>download</filename> is modified to reference the new font. The <filename>download</filename> must reference the internal name of the font. This can easily be determined from the groff font file as illustrated:
<lineannotation>Create the .pfa font file</lineannotation>
<prompt>%</prompt> <userinput>pfbtops /usr/local/share/fonts/type1/showboat.pfb &gt;showboat.pfa</userinput>
Of course, if <filename>.pfa</filename> is already available, just use a symbolic link to reference it.
<lineannotation>Get the internal font name</lineannotation>
<prompt>%</prompt> <userinput>fgrep internalname SHOWBOAT</userinput>
internalname Showboat

<lineannotation>Tell groff that the font must be downloaded</lineannotation>
<prompt>%</prompt> <userinput>ex download
:$a
Showboat showboat.pfa
.
:wq</userinput>
To test the font:
<prompt>%</prompt> <userinput>cd /tmp</userinput>
<prompt>%</prompt> <userinput>cat &gt;example.t &lt;&lt;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(48\f5H\s0\fRere 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</userinput>
<prompt>%</prompt> <userinput>groff -Tps example.t &gt;example.ps</userinput>

<lineannotation>To use ghostscript/ghostview</lineannotation>
<prompt>%</prompt> <userinput>ghostview example.ps</userinput>

<lineannotation>To print it</lineannotation>
<prompt>%</prompt> <userinput>lpr -Ppostscript example.ps</userinput>
References: <filename>/usr/src/gnu/usr.bin/groff/afmtodit/afmtodit.man</filename>, <citerefentry><refentrytitle>groff_font</refentrytitle><manvolnum>5</manvolnum></citerefentry>, <citerefentry><refentrytitle>groff_char</refentrytitle><manvolnum>7</manvolnum></citerefentry>, <citerefentry><refentrytitle>pfbtops</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
Converting TrueType Fonts to a groff/PostScript Format For groff
This potentially requires a bit of work, simply because it depends on some utilities that are not installed as part of the base system. They are:
<command>ttf2pf</command>
TrueType to PostScript conversion utilities. This allows conversion of a TrueType font to an ascii font metric (<filename>.afm</filename>) file.
Currently available at <uri xlink:href="http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf/">http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf/</uri>. Note: These files are PostScript programs and must be downloaded to disk by holding down <keycap>Shift</keycap> when clicking on the link. Otherwise, your browser may try to launch <application>ghostview</application> to view them.
The files of interest are:
<filename>GS_TTF.PS</filename>
<filename>PF2AFM.PS</filename>
<filename>ttf2pf.ps</filename>
The funny upper/lower case is due to their being intended also for DOS shells. <filename>ttf2pf.ps</filename> makes use of the others as upper case, so any renaming must be consistent with this. (Actually, <filename>GS_TTF.PS</filename> and <filename>PFS2AFM.PS</filename> are supposedly part of the <application>Ghostscript</application> distribution, but it is just as easy to use these as an isolated utility. FreeBSD does not seem to include the latter.) You also may want to have these installed to <filename>/usr/local/share/groff_font/devps</filename>(?).
<command>afmtodit</command>
Creates font files for use with <application>groff</application> from ascii font metrics file. This usually resides in the directory, <filename>/usr/src/contrib/groff/afmtodit</filename>, and requires some work to get going.

Loading…

No matching activity found.

Browse all component changes

Source information

Source string comment
(itstool) path: informalexample/screen
Flags
no-wrap, read-only
Source string location
article.translate.xml:639
String age
a year ago
Source string age
a year ago
Translation file
articles/fonts.pot, string 101