diff --git a/en_US.ISO8859-1/articles/fonts/article.sgml b/en_US.ISO8859-1/articles/fonts/article.sgml index b21085c2b8..dd7b2cd475 100644 --- a/en_US.ISO8859-1/articles/fonts/article.sgml +++ b/en_US.ISO8859-1/articles/fonts/article.sgml @@ -1,4 +1,4 @@ - + @@ -23,265 +23,288 @@ -->
+ + Fonts and FreeBSD - -Fonts and FreeBSD -A Tutorial + A Tutorial - - -Dave -Bodenstab - -
imdave@synet.net
-
-
-
+ + + Dave -Wed Aug 7, 1996 + Bodenstab -This document contains a description of the various -font files that may be used with FreeBSD and the syscons driver, X11, -Ghostscript and Groff. Cookbook examples are provided for switching -the syscons display to 80x60 mode, and for using type 1 fonts with -the above application programs. + +
+ imdave@synet.net +
+
+
+
-
+ Wed Aug 7, 1996 - -Introduction + + This document contains a description of the various font + files that may be used with FreeBSD and the syscons driver, + X11, Ghostscript and Groff. Cookbook examples are provided + for switching the syscons display to 80x60 mode, and for using + type 1 fonts with the above application programs. + +
-There are many sources of fonts available, and one might ask -how they might be used with FreeBSD. The answer can be found by -carefully searching the documentation for the component that one -would like to use. This is very time consuming, so this tutorial is -an attempt to provide a shortcut for others who might be -interested. + + Introduction - + There are many sources of fonts available, and one might ask + how they might be used with FreeBSD. The answer can be found by + carefully searching the documentation for the component that one + would like to use. This is very time consuming, so this + tutorial is an attempt to provide a shortcut for others who + might be interested. + - -Basic terminology + + Basic terminology -There are many different font formats and associated font file -suffixes. A few that will be addressed here are: - - + There are many different font formats and associated font + file suffixes. A few that will be addressed here are: -.pfa, .pfb + + + .pfa, .pfb -Postscript type 1 fonts. The .pfa is the -Ascii form and .pfb the -Binary form. + + Postscript type 1 fonts. The + .pfa is the + Ascii form and + .pfb the Binary + form. + + - + + .afm -.afm + + The font metrics associated with a type 1 font. + + -The font metrics associated with a type 1 -font. + + .pfm - + + The printer font metrics associated with a type 1 + font. + + -.pfm + + .ttf -The printer font metrics associated with a type 1 -font. + + A TrueType font + + - + + .fot -.ttf + + An indirect reference to a TrueType font (not an + actual font) + + -A TrueType font + + .fon, .fnt - + + Bitmapped screen fonts + + + -.fot + The .fot file is used by Windows as + sort of a symbolic link to the actual TrueType font + (.ttf) file. The .fon + font files are also used by Windows. I know of no way to use + this font format with FreeBSD. + -An indirect reference to a TrueType font (not an -actual font) + + What font formats can I use? - + Which font file format is useful depends on the application + being used. FreeBSD by itself uses no fonts. Application + programs and/or drivers may make use of the font files. Here is + a small cross reference of application/driver to the font type + suffixes: -.fon, .fnt + + + Driver -Bitmapped screen fonts + + + + syscons - - - -The .fot file is used by Windows as sort -of a symbolic link to the actual TrueType font -(.ttf) file. The .fon font -files are also used by Windows. I know of no way to use this font -format with FreeBSD. + + .fnt + + + + + - + + Application - -What font formats can I use? + + + + Ghostscript -Which font file format is useful depends on the application -being used. FreeBSD by itself uses no fonts. Application programs -and/or drivers may make use of the font files. Here is a small cross -reference of application/driver to the font type suffixes: + + .pfa, + .pfb, + .ttf + + - -Driver - - -syscons - -.fnt - - - - - - - + + X11 -Application + + .pfa, + .pfb + + - - -Ghostscript - -.pfa, .pfb, .ttf - - - + + Groff -X11 + + .pfa, + .afm + + - -.pfa, .pfb - - - + + Povray -Groff + + .ttf + + + + + + - -.pfa, .afm - - - + The .fnt suffix is used quite + frequently. I suspect that whenever someone wanted to create a + specialized font file for their application, more often than not + they chose this suffix. Therefore, it is likely that files with + this suffix are not all the same format; specifically, the + .fnt files used by syscons under FreeBSD + may not be the same format as a .fnt file + one encounters in the MSDOS/Windows environment. I have not + made any attempt at using other .fnt files + other than those provided with FreeBSD. + -Povray + + Setting a virtual console to 80x60 line mode - -.ttf - - - - - - - - - -The .fnt suffix is used quite frequently. -I suspect that whenever someone wanted to create a specialized font -file for their application, more often than not they chose this -suffix. Therefore, it is likely that files with this suffix are not -all the same format; specifically, the .fnt -files used by syscons under FreeBSD may not be the same format as a -.fnt file one encounters in the MSDOS/Windows -environment. I have not made any attempt at using other -.fnt files other than those provided with -FreeBSD. + First, a 8x8 font must be loaded. + /etc/sysconfig should contain the + lines: - + + # Choose font 8x8 from /usr/share/syscons/fonts/* (or NO for default) +font8x8=/usr/share/syscons/fonts/cp437-8x8.fnt + + - -Setting a virtual console to 80x60 line mode + The command to actually switch the mode is + &man.vidcontrol.1: -First, a 8x8 font must be loaded. -/etc/sysconfig should contain the lines: - - -# Choose font 8x8 from /usr/share/syscons/fonts/* (or NO for default) -font8x8=/usr/share/syscons/fonts/cp437-8x8.fnt - - -The command to actually switch the mode is -&man.vidcontrol.1: - - -bash$ vidcontrol VGA_80x60 - - -Various screen orientated programs, such as -&man.vi.1, must be able to -determine the current screen dimensions. These can be set with -&man.stty.1;: - - -bash$ stty crt rows 60 columns 80 - - -To make this more seamless, one can embed these commands in the -startup scripts so it takes place when the system boots. One way to -do this is: - - + + bash$ vidcontrol VGA_80x60 + + - -Modify /etc/sysconfig as above - + Various screen orientated programs, such as &man.vi.1, must + be able to determine the current screen dimensions. These can + be set with &man.stty.1;: - -Add to /etc/rc.local: - - -for tty in /dev/ttyv? + + bash$ stty crt rows 60 columns 80 + + + + To make this more seamless, one can embed these commands in + the startup scripts so it takes place when the system boots. + One way to do this is: + + + + Modify /etc/sysconfig as + above + + + + Add to /etc/rc.local: + + + for tty in /dev/ttyv? do vidcontrol VGA_80x60 <$tty >/dev/null 2>&1 -done - - +done + + + - -Add to /etc/profile: - - -TTYNAME=`basename \`tty\`` + + Add to /etc/profile: + + + TTYNAME=`basename \`tty\`` if expr "$TTYNAME" : 'ttyv' >/dev/null then stty crt rows 60 columns 80 -fi - - +fi + + + + - - -References: -&man.stty.1;, -&man.vidcontrol.1;. + References: &man.stty.1;, &man.vidcontrol.1;. + - + + Using type 1 fonts with X11 - -Using type 1 fonts with X11 + X11 can use either the .pfa or the + .pfb format fonts. The X11 fonts are + located in various subdirectories under + /usr/X11R6/lib/X11/fonts. Each font file + is cross referenced to its X11 name by the contents of the + fonts.dir file in each directory. -X11 can use either the .pfa or the -.pfb format fonts. The X11 fonts are located in -various subdirectories under -/usr/X11R6/lib/X11/fonts. Each font file is -cross referenced to its X11 name by the contents of the -fonts.dir file in each directory. + There is already a directory named Type1. The + most straight forward way to add a new font is to put it into + this directory. A better way is to keep all new fonts in a + separate directory and use a symbolic link to the additional + font. This allows one to more easily keep track of ones fonts + without confusing them with the fonts that were originally + provided. For example: -There is already a directory named Type1. The most -straight forward way to add a new font is to put it into this -directory. A better way is to keep all new fonts in a separate -directory and use a symbolic link to the additional font. This -allows one to more easily keep track of ones fonts without confusing -them with the fonts that were originally provided. For -example: - - -Create a directory to contain the font files + + Create a directory to contain the font files bash$ mkdir -p /usr/local/share/fonts/type1 bash$ cd /usr/local/share/fonts/type1 @@ -292,16 +315,17 @@ bash$ cp /cdrom/fonts/atm/showboat/showboat.pfb . bash$ cp /cdrom/fonts/atm/showboat/showboat.afm . Maintain an index to cross reference the fonts -bash$ echo showboat - InfoMagic CICA, Dec 1994, /fonts/atm/showboat >>INDEX - - -Now, to use a new font with X11, one must make the font file -available and update the font name files. The X11 font names look -like: - - --bitstream-charter-medium-r-normal-xxx-0-0-0-0-p-0-iso8859-1 - | | | | | | | | | | | | \ \ +bash$ echo showboat - InfoMagic CICA, Dec 1994, /fonts/atm/showboat >>INDEX + + + + Now, to use a new font with X11, one must make the font file + available and update the font name files. The X11 font names + look like: + + + -bitstream-charter-medium-r-normal-xxx-0-0-0-0-p-0-iso8859-1 + | | | | | | | | | | | | \ \ | | | | | \ \ \ \ \ \ \ +----+- character set | | | | \ \ \ \ \ \ \ +- average width | | | | \ \ \ \ \ \ +- spacing @@ -310,18 +334,18 @@ like: | | | \ \ \ \ +- points | | | \ \ \ +- pixels | | | \ \ \ - foundry family weight slant width additional style - - -A new name needs to be created for each new font. If you have -some information from the documentation that accompanied the font, -then it could serve as the basis for creating the name. If there is -no information, then you can get some idea by using -&man.strings.1; on the font -file. For example: - - -bash$ strings showboat.pfb | more + foundry family weight slant width additional style + + + + A new name needs to be created for each new font. If you + have some information from the documentation that accompanied + the font, then it could serve as the basis for creating the + name. If there is no information, then you can get some idea by + using &man.strings.1; on the font file. For example: + + + bash$ strings showboat.pfb | more %!FontType1-1.0: Showboat 001.001 %%CreationDate: 1/15/91 5:16:03 PM %%VMusage: 1024 45747 @@ -345,87 +369,110 @@ FontDirectory/Showboat known{/Showboat findfont dup/UniqueID known{dup 1991 by David Rakowski. Alle Rechte Vorbehalten.) readonly def end readonly def /FontName /Showboat def ---stdin-- - - -Using this information, a possible name might be: - - --type1-Showboat-medium-r-normal-decorative-0-0-0-0-p-0-iso8859-1 - - -The components of our name are: - - +--stdin-- + + -Foundry - -Lets just name all the new fonts type1. - - + Using this information, a possible name might be: -Family - -The name of the font. - - + + -type1-Showboat-medium-r-normal-decorative-0-0-0-0-p-0-iso8859-1 + + -Weight - -Normal, bold, medium, semibold, etc. From the -strings1 output -above, it appears that this font has a weight of -medium. - - + The components of our name are: -Slant - -roman, italic, oblique, -etc. Since the ItalicAngle is zero, -roman will be used. - - + + + Foundry -Width - -Normal, wide, condensed, extended, etc. Until it can be examined, -the assumption will be normal. - - + + Lets just name all the new fonts + type1. + + -Additional style - -Usually omitted, but this will indicate that -the font contains decorative capital letters. - - + + Family -Spacing - -proportional or monospaced. Proportional -is used since isFixedPitch is false. - - + + The name of the font. + + - - -All of these names are arbitrary, but one should strive to be -compatible with the existing conventions. A font is referenced by -name with possible wild cards by an X11 program, so the name chosen -should make some sense. One might begin by simply using - -…-normal-r-normal-…-p-… - -as the name, and then use -xfontsel1 to examine it -and adjust the name based on the appearance of the font. + + Weight -So, to complete our example: - - -Make the font accessible to X11 + + Normal, bold, medium, semibold, etc. From the + strings1 + output above, it appears that this font has a weight of + medium. + + + + + Slant + + + roman, italic, oblique, etc. Since the + ItalicAngle is zero, + roman will be used. + + + + + Width + + + Normal, wide, condensed, extended, etc. Until it can + be examined, the assumption will be + normal. + + + + + Additional style + + + Usually omitted, but this will indicate that the font + contains decorative capital letters. + + + + + Spacing + + + proportional or monospaced. + Proportional is used since + isFixedPitch is false. + + + + + All of these names are arbitrary, but one should strive to + be compatible with the existing conventions. A font is + referenced by name with possible wild cards by an X11 program, + so the name chosen should make some sense. One might begin by + simply using + + + …-normal-r-normal-…-p-… + + + + as the name, and then use + xfontsel1 to + examine it and adjust the name based on the appearance of the + font. + + So, to complete our example: + + + Make the font accessible to X11 bash$ cd /usr/X11R6/lib/X11/fonts/Type1 bash$ ln -s /usr/local/share/fonts/type1/showboat.pfb . @@ -449,29 +496,28 @@ bash$ cp fonts.dir fonts.scale bash$ xset fp rehash Examine the new font -bash$ xfontsel -pattern -type1-* - - -References: -&man.xfontsel.1;, -&man.xset.1;, -The X Windows System in a Nutshell, O'Reilly & Associates. +bash$ xfontsel -pattern -type1-* + + - + References: &man.xfontsel.1;, &man.xset.1;, The X + Windows System in a Nutshell, O'Reilly & + Associates. + - -Using type 1 fonts with Ghostscript + + Using type 1 fonts with Ghostscript -Ghostscript references a font via its Fontmap -file. This must be modified in a similar way to the X11 -fonts.dir file. Ghostscript can use either the -.pfa or the .pfb format -fonts. Using the font from the previous example, here is how to use -it with Ghostscript: - - -Put the font in Ghostscript's font directory + Ghostscript references a font via its Fontmap + file. This must be modified in a similar way to the X11 + fonts.dir file. Ghostscript can use either + the .pfa or the .pfb + format fonts. Using the font from the previous example, here is + how to use it with Ghostscript: + + + Put the font in Ghostscript's font directory bash$ cd /usr/local/share/ghostscript/fonts bash$ ln -s /usr/local/share/fonts/type1/showboat.pfb . @@ -497,46 +543,49 @@ Loading Showboat font from /usr/local/share/ghostscript/fonts/showboat.pfb... >>showpage, press <return> to continue<< >>showpage, press <return> to continue<< >>showpage, press <return> to continue<< -GS>quit - - -References: fonts.txt in the Ghostscript -4.01 distribution +GS>quit + + - + References: fonts.txt in the + Ghostscript 4.01 distribution + - -Using type 1 fonts with Groff + + Using type 1 fonts with Groff -Now that the new font can be used by both X11 and Ghostscript, -how can one use the new font with groff? First of all, since we are -dealing with type 1 postscript fonts, the groff device that is -applicable is the ps device. A font file must be -created for each font that groff can use. A groff font name is just -a file in /usr/share/groff_font/devps. With our -example, the font file could be -/usr/share/groff_font/devps/SHOWBOAT. The file -must be created using tools provided by groff. + Now that the new font can be used by both X11 and + Ghostscript, how can one use the new font with groff? First of + all, since we are dealing with type 1 postscript fonts, the + groff device that is applicable is the ps + device. A font file must be created for each font that groff + can use. A groff font name is just a file in + /usr/share/groff_font/devps. With our + example, the font file could be + /usr/share/groff_font/devps/SHOWBOAT. The + file must be created using tools provided by groff. -The first tool is afmtodit. 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: - - -bash$ cp /usr/src/gnu/usr.bin/groff/afmtodit/afmtodit.pl /tmp + The first tool is afmtodit. 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: + + + bash$ cp /usr/src/gnu/usr.bin/groff/afmtodit/afmtodit.pl /tmp bash$ ex /tmp/afmtodit.pl :1c #!/usr/bin/perl -P- . -:wq - - -This tool will create the groff font file from the metrics file -(.afm suffix.) Continuing with our -example: - - -Many .afm files are in Mac format&hellip ^M delimited lines +:wq + + + + This tool will create the groff font file from the metrics + file (.afm suffix.) Continuing with our + example: + + + Many .afm files are in Mac format&hellip ^M delimited lines We need to convert them to unix style ^J delimited lines bash$ cd /tmp bash$ cat /usr/local/share/fonts/type1/showboat.afm | @@ -544,33 +593,37 @@ bash$ cat /usr/local/share/fonts/type1/showboat.afm | Now create the groff font file bash$ cd /usr/share/groff_font/devps -bash$ /tmp/afmtodit.pl -d DESC -e text.enc /tmp/showboat.afm generate/textmap SHOWBOAT - - -The font can now be referenced with the name SHOWBOAT. - -If ghostscript is used to drive the printers on the system, -then nothing more needs to be done. However, if true postscript -printers are used, then the font must be down loaded 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 down loadable font. The pfbtops tool -is used to create the .pfa format of the font, -and the download file is modified to reference the new -font. The download file must reference the internal -name of the font. This can easily be determined from the groff font -file as illustrated: - - -Create the .pfa font file -bash$ pfbtops /usr/local/share/fonts/type1/showboat.pfb >showboat.pfa - - -Of course, if the .pfa file is already -available, just use a symbolic link to reference it. - - -Get the internal font name +bash$ /tmp/afmtodit.pl -d DESC -e text.enc /tmp/showboat.afm generate/textmap SHOWBOAT + + + + The font can now be referenced with the name + SHOWBOAT. + + If ghostscript is used to drive the printers on the system, + then nothing more needs to be done. However, if true postscript + printers are used, then the font must be down loaded 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 down loadable font. + The pfbtops tool is used to create the + .pfa format of the font, and the + download file is modified to reference the new + font. The download file must reference the + internal name of the font. This can easily be determined from + the groff font file as illustrated: + + + Create the .pfa font file +bash$ pfbtops /usr/local/share/fonts/type1/showboat.pfb >showboat.pfa + + + + Of course, if the .pfa file is already + available, just use a symbolic link to reference it. + + + Get the internal font name bash$ fgrep internalname SHOWBOAT internalname Showboat @@ -579,13 +632,14 @@ bash$ ex download :$a Showboat showboat.pfa . -:wq - - -To test the font: - - -bash$ cd /tmp +:wq + + + + To test the font: + + + bash$ cd /tmp bash$ cat >example.t <<EOF .sp 5 .ps 16 @@ -618,16 +672,14 @@ bash$ groff -Tps example.t >example.ps bash$ ghostview example.ps To print it -bash$ lpr -Ppostscript example.ps - - -References: -/usr/src/gnu/usr.bin/groff/afmtodit/afmtodit.man, -&man.groff.font.5;, -&man.groff.char.7;, -&man.pfbtops.1;. - - +bash$ lpr -Ppostscript example.ps + + + + References: + /usr/src/gnu/usr.bin/groff/afmtodit/afmtodit.man, + &man.groff.font.5;, &man.groff.char.7;, &man.pfbtops.1;. + Converting TrueType fonts to a groff/postscript format for @@ -635,23 +687,23 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> <para>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:</para> + base system. They are:</para> <variablelist> <varlistentry> <term><command>ttf2pf</command></term> <listitem> - <para>TrueType to postscript convertsion utilities. This + <para>TrueType to postscript convertsion utilities. This allows conversion of a TrueType font to an ascii font metric (<filename>.afm</filename>) file.</para> - + <para>Currently available at <ulink - url="http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf/">http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf</ulink>. + url="http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf/">http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf</ulink>. Note: These files are postscript programs and must be downloaded to disk by holding down the - <keycap>Shift</keycap> key when clicking on the - link. Otherwise, your browser may try to launch + <keycap>Shift</keycap> key when clicking on the link. + Otherwise, your browser may try to launch <application>ghostview</application> to view them.</para> <para>The files of interest are:</para> @@ -673,8 +725,8 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> <para>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 + 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 ghostscript distribution, but it's just as easy to use these as an isolated utility. FreeBSD doesn't seem to @@ -689,7 +741,7 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> <listitem> <para>Creates font files for use with groff from ascii font - metrics file. This usually resides in the directory, + metrics file. This usually resides in the directory, <filename>/usr/src/contrib/groff/afmtodit</filename>, and requires some work to get going.</para> @@ -700,11 +752,10 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> location.</para> </note> - <para>In the work area, you'll need to make the - utility. Just type:</para> + <para>In the work area, you'll need to make the utility. + Just type:</para> - <screen> -<prompt>#</prompt> <userinput>make -f Makefile.sub afmtodit</userinput> + <screen><prompt>#</prompt> <userinput>make -f Makefile.sub afmtodit</userinput> </screen> <para>You may also need to copy @@ -724,8 +775,7 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> <para>Create the <filename>.afm</filename> file by typing:</para> - <screen> -<prompt>%</prompt> <userinput>gs <optional>-dNODISPLAY</optional> <optional>-q</optional> -- ttf2pf.ps <replaceable>TTF_name</replaceable> <optional><replaceable>PS_font_name</replaceable> <optional><replaceable>AFM_name</replaceable></optional></optional></userinput> + <screen><prompt>%</prompt> <userinput>gs <optional>-dNODISPLAY</optional> <optional>-q</optional> -- ttf2pf.ps <replaceable>TTF_name</replaceable> <optional><replaceable>PS_font_name</replaceable> <optional><replaceable>AFM_name</replaceable></optional></optional></userinput> </screen> <para>Where, <replaceable>TTF_name</replaceable> is your @@ -739,15 +789,14 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> <para>This also produces a <filename>.pfa</filename> file, the ascii postscript font metrics file - (<filename>.pfb</filename> is for the binrary form). This + (<filename>.pfb</filename> is for the binrary form). This won't be needed, but could (I think) be useful for a fontserver.</para> <para>For example, to convert the 30f9 Barcode font using the default file names, use the following command:</para> - <screen> -<prompt>%</prompt> <userinput>gs -dNODISPLAY -- ttf2pf.ps 3of9.ttf</userinput> + <screen><prompt>%</prompt> <userinput>gs -dNODISPLAY -- ttf2pf.ps 3of9.ttf</userinput> 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. @@ -758,8 +807,7 @@ Converting 3of9.ttf to 3of9.pfa and 3of9.afm. <filename>A.pfa</filename> and <filename>B.afm</filename>, then use this command:</para> - <screen> -<prompt>%</prompt> <userinput>gs -dNODISPLAY -- ttf2pf.ps 3of9.ttf A B</userinput> + <screen><prompt>%</prompt> <userinput>gs -dNODISPLAY -- ttf2pf.ps 3of9.ttf A B</userinput> 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. @@ -772,16 +820,15 @@ Converting 3of9.ttf to A.pfa and B.afm. <para>Change directories to <filename>/usr/share/groff_font/devps</filename> so as to - make the following command easier to execute. You'll - probably need root priviledges for this. (Or, if you're + make the following command easier to execute. You'll + probably need root priviledges for this. (Or, if you're paranoid about working there, make sure you reference the files <filename>DESC</filename>, <filename>text.enc</filename> and <filename>generate/textmap</filename> as being in this directory.)</para> - <screen> -<prompt>%</prompt> <userinput>afmtodit -d DESC -e text.enc file.afm \ + <screen><prompt>%</prompt> <userinput>afmtodit -d DESC -e text.enc file.afm \ generate/textmap <replaceable>PS_font_name</replaceable></userinput> </screen> @@ -790,14 +837,12 @@ Converting 3of9.ttf to A.pfa and B.afm. <command>ttf2pf.ps</command> above, and <replaceable>PS_font_name</replaceable> is the font name used from that command, as well as the name that - &man.groff.1; - will use for references to this font. For example, assuming - you used the first <command>tiff2pf.ps</command> command - above, then the 3of9 Barcode font can be created using the - command:</para> + &man.groff.1; will use for references to this font. For + example, assuming you used the first + <command>tiff2pf.ps</command> command above, then the 3of9 + Barcode font can be created using the command:</para> - <screen> -<prompt>%</prompt> <userinput>afmtodit -d DESC -e text.enc 3of9.afm \ + <screen><prompt>%</prompt> <userinput>afmtodit -d DESC -e text.enc 3of9.afm \ generate/textmap 3of9</userinput> </screen> @@ -814,137 +859,146 @@ Converting 3of9.ttf to A.pfa and B.afm. <filename>.afm</filename> file prior to running <command>afmtodit</command>. This name must also match the one used in the Fontmap file if you wish to pipe - &man.groff.1; into - &man.gs.1;.</para> + &man.groff.1; into &man.gs.1;.</para> </listitem> </orderedlist> </sect1> -<sect1> -<title>Can TrueType fonts be used with other programs? + + Can TrueType fonts be used with other programs? -The TrueType font format is used by Windows, Windows 95, and -Mac's. It is quite popular and there are a great number of -fonts available in this format. + The TrueType font format is used by Windows, Windows 95, and + Mac's. It is quite popular and there are a great number of + fonts available in this format. -Unfortunately, there are few applications that I am aware of -that can use this format: Ghostscript and Povray come to mind. -Ghostscript's support, according to the documentation, is rudimentary -and the results are likely to be inferior to type 1 fonts. -Povray version 3 also has the ability to use TrueType fonts, but -I rather doubt many people will be creating documents as a series of -raytraced pages :-). + Unfortunately, there are few applications that I am aware of + that can use this format: Ghostscript and Povray come to mind. + Ghostscript's support, according to the documentation, is + rudimentary and the results are likely to be inferior to type 1 + fonts. Povray version 3 also has the ability to use TrueType + fonts, but I rather doubt many people will be creating documents + as a series of raytraced pages :-). -This rather dismal situation may soon change. -The FreeType Project -is currently developing a useful set of FreeType tools: - - - -The xfsft font server for X11 can serve -TrueType fonts in addition to regular fonts. Though currently in -beta, it is said to be quite useable. See Juliusz -Chroboczek's page for further information. Porting instructions -for FreeBSD can be found at Stephen Montgomery's -software page. - - - -xfstt is another font -server for X11, available under -ftp://sunsite.unc.edu/pub/Linux/X11/fonts. - - -A program called ttf2bdf can produce -BDF files suitable for use in an X environment from TrueType files. Linux -binaries are said to be available from ftp://crl.nmsu.edu/CLR/multiling/General/. - - - - -For people requiring the use of Asian TrueType fonts, the -XTT font server may be worth a look. Information about -XTT can be found at URL: http://hawk.ise.chuo-u.ac.jp/student/person/tshiozak/study/freebsd-at-random/x-tt/index-en.html. - - - -and others … - - - -The -FreeType Projects page - is a good starting point for information on these and other -free TrueType projects. - - + This rather dismal situation may soon change. The FreeType Project is + currently developing a useful set of FreeType tools: - -Where can additional fonts be obtained? + + + The xfsft font server for X11 can + serve TrueType fonts in addition to regular fonts. Though + currently in beta, it is said to be quite useable. See + Juliusz + Chroboczek's page for further information. + Porting instructions for FreeBSD can be found at Stephen + Montgomery's software page. + -Many fonts are available on the Internet. They are either -entirely free, or are share-ware. In addition, there are many -inexpensive CDROMs available that contain many fonts. Some Internet -locations (as of August 1996) are: - - + + xfstt is another font server for X11, + available under + ftp://sunsite.unc.edu/pub/Linux/X11/fonts. + -ftp://ftp.winsite.com (Formerly -CICA) + + A program called ttf2bdf can produce + BDF files suitable for use in an X environment from TrueType + files. Linux binaries are said to be available from ftp://crl.nmsu.edu/CLR/multiling/General/. + -http://www.simtel.net/simcgi-bin/dosfind.cgi + + For people requiring the use of Asian TrueType fonts, + the XTT font server may be worth a look. + Information about XTT can be found at + URL: http://hawk.ise.chuo-u.ac.jp/student/person/tshiozak/study/freebsd-at-random/x-tt/index-en.html. + -ftp://ftp.coast.net/ + + and others … + + -http://af-pc-plloyd.ecel.uwa.edu.au/fonts/index.html + The FreeType Projects + page is a good starting point for information on + these and other free TrueType projects. + -http://www.esselte.com/letraset/index.html + + Where can additional fonts be obtained? -http://www.inil.com/users/elfring/esf.htm + Many fonts are available on the Internet. They are either + entirely free, or are share-ware. In addition, there are many + inexpensive CDROMs available that contain many fonts. Some + Internet locations (as of August 1996) are: - - - + + + ftp://ftp.winsite.com + (Formerly CICA) + - -Additional questions + + http://www.simtel.net/simcgi-bin/dosfind.cgi + - + + ftp://ftp.coast.net/ + - -What use are the .pfm files? - + + http://af-pc-plloyd.ecel.uwa.edu.au/fonts/index.html + - -Can one generate the .afm file from a .pfa or .pfb? - + + http://www.esselte.com/letraset/index.html + - -How to generate the groff character mapping files for postscript fonts -with non-standard character names? - + + http://www.inil.com/users/elfring/esf.htm + + + - -Can xditview and devX?? devices be setup to access all the new fonts? - + + Additional questions - -It would be good to have examples of using TrueType fonts with povray and -ghostscript. - + + + What use are the .pfm files? + - - - + + Can one generate the .afm file from + a .pfa or + .pfb? + + + + How to generate the groff character mapping files for + postscript fonts with non-standard character names? + + + + Can xditview and devX?? devices be setup to access all + the new fonts? + + + + It would be good to have examples of using TrueType + fonts with povray and ghostscript. + + +
diff --git a/en_US.ISO_8859-1/articles/fonts/article.sgml b/en_US.ISO_8859-1/articles/fonts/article.sgml index b21085c2b8..dd7b2cd475 100644 --- a/en_US.ISO_8859-1/articles/fonts/article.sgml +++ b/en_US.ISO_8859-1/articles/fonts/article.sgml @@ -1,4 +1,4 @@ - + @@ -23,265 +23,288 @@ -->
+ + Fonts and FreeBSD - -Fonts and FreeBSD -A Tutorial + A Tutorial - - -Dave -Bodenstab - -
imdave@synet.net
-
-
-
+ + + Dave -Wed Aug 7, 1996 + Bodenstab -This document contains a description of the various -font files that may be used with FreeBSD and the syscons driver, X11, -Ghostscript and Groff. Cookbook examples are provided for switching -the syscons display to 80x60 mode, and for using type 1 fonts with -the above application programs. + +
+ imdave@synet.net +
+
+
+
-
+ Wed Aug 7, 1996 - -Introduction + + This document contains a description of the various font + files that may be used with FreeBSD and the syscons driver, + X11, Ghostscript and Groff. Cookbook examples are provided + for switching the syscons display to 80x60 mode, and for using + type 1 fonts with the above application programs. + +
-There are many sources of fonts available, and one might ask -how they might be used with FreeBSD. The answer can be found by -carefully searching the documentation for the component that one -would like to use. This is very time consuming, so this tutorial is -an attempt to provide a shortcut for others who might be -interested. + + Introduction - + There are many sources of fonts available, and one might ask + how they might be used with FreeBSD. The answer can be found by + carefully searching the documentation for the component that one + would like to use. This is very time consuming, so this + tutorial is an attempt to provide a shortcut for others who + might be interested. + - -Basic terminology + + Basic terminology -There are many different font formats and associated font file -suffixes. A few that will be addressed here are: - - + There are many different font formats and associated font + file suffixes. A few that will be addressed here are: -.pfa, .pfb + + + .pfa, .pfb -Postscript type 1 fonts. The .pfa is the -Ascii form and .pfb the -Binary form. + + Postscript type 1 fonts. The + .pfa is the + Ascii form and + .pfb the Binary + form. + + - + + .afm -.afm + + The font metrics associated with a type 1 font. + + -The font metrics associated with a type 1 -font. + + .pfm - + + The printer font metrics associated with a type 1 + font. + + -.pfm + + .ttf -The printer font metrics associated with a type 1 -font. + + A TrueType font + + - + + .fot -.ttf + + An indirect reference to a TrueType font (not an + actual font) + + -A TrueType font + + .fon, .fnt - + + Bitmapped screen fonts + + + -.fot + The .fot file is used by Windows as + sort of a symbolic link to the actual TrueType font + (.ttf) file. The .fon + font files are also used by Windows. I know of no way to use + this font format with FreeBSD. + -An indirect reference to a TrueType font (not an -actual font) + + What font formats can I use? - + Which font file format is useful depends on the application + being used. FreeBSD by itself uses no fonts. Application + programs and/or drivers may make use of the font files. Here is + a small cross reference of application/driver to the font type + suffixes: -.fon, .fnt + + + Driver -Bitmapped screen fonts + + + + syscons - - - -The .fot file is used by Windows as sort -of a symbolic link to the actual TrueType font -(.ttf) file. The .fon font -files are also used by Windows. I know of no way to use this font -format with FreeBSD. + + .fnt + + + + + - + + Application - -What font formats can I use? + + + + Ghostscript -Which font file format is useful depends on the application -being used. FreeBSD by itself uses no fonts. Application programs -and/or drivers may make use of the font files. Here is a small cross -reference of application/driver to the font type suffixes: + + .pfa, + .pfb, + .ttf + + - -Driver - - -syscons - -.fnt - - - - - - - + + X11 -Application + + .pfa, + .pfb + + - - -Ghostscript - -.pfa, .pfb, .ttf - - - + + Groff -X11 + + .pfa, + .afm + + - -.pfa, .pfb - - - + + Povray -Groff + + .ttf + + + + + + - -.pfa, .afm - - - + The .fnt suffix is used quite + frequently. I suspect that whenever someone wanted to create a + specialized font file for their application, more often than not + they chose this suffix. Therefore, it is likely that files with + this suffix are not all the same format; specifically, the + .fnt files used by syscons under FreeBSD + may not be the same format as a .fnt file + one encounters in the MSDOS/Windows environment. I have not + made any attempt at using other .fnt files + other than those provided with FreeBSD. + -Povray + + Setting a virtual console to 80x60 line mode - -.ttf - - - - - - - - - -The .fnt suffix is used quite frequently. -I suspect that whenever someone wanted to create a specialized font -file for their application, more often than not they chose this -suffix. Therefore, it is likely that files with this suffix are not -all the same format; specifically, the .fnt -files used by syscons under FreeBSD may not be the same format as a -.fnt file one encounters in the MSDOS/Windows -environment. I have not made any attempt at using other -.fnt files other than those provided with -FreeBSD. + First, a 8x8 font must be loaded. + /etc/sysconfig should contain the + lines: - + + # Choose font 8x8 from /usr/share/syscons/fonts/* (or NO for default) +font8x8=/usr/share/syscons/fonts/cp437-8x8.fnt + + - -Setting a virtual console to 80x60 line mode + The command to actually switch the mode is + &man.vidcontrol.1: -First, a 8x8 font must be loaded. -/etc/sysconfig should contain the lines: - - -# Choose font 8x8 from /usr/share/syscons/fonts/* (or NO for default) -font8x8=/usr/share/syscons/fonts/cp437-8x8.fnt - - -The command to actually switch the mode is -&man.vidcontrol.1: - - -bash$ vidcontrol VGA_80x60 - - -Various screen orientated programs, such as -&man.vi.1, must be able to -determine the current screen dimensions. These can be set with -&man.stty.1;: - - -bash$ stty crt rows 60 columns 80 - - -To make this more seamless, one can embed these commands in the -startup scripts so it takes place when the system boots. One way to -do this is: - - + + bash$ vidcontrol VGA_80x60 + + - -Modify /etc/sysconfig as above - + Various screen orientated programs, such as &man.vi.1, must + be able to determine the current screen dimensions. These can + be set with &man.stty.1;: - -Add to /etc/rc.local: - - -for tty in /dev/ttyv? + + bash$ stty crt rows 60 columns 80 + + + + To make this more seamless, one can embed these commands in + the startup scripts so it takes place when the system boots. + One way to do this is: + + + + Modify /etc/sysconfig as + above + + + + Add to /etc/rc.local: + + + for tty in /dev/ttyv? do vidcontrol VGA_80x60 <$tty >/dev/null 2>&1 -done - - +done + + + - -Add to /etc/profile: - - -TTYNAME=`basename \`tty\`` + + Add to /etc/profile: + + + TTYNAME=`basename \`tty\`` if expr "$TTYNAME" : 'ttyv' >/dev/null then stty crt rows 60 columns 80 -fi - - +fi + + + + - - -References: -&man.stty.1;, -&man.vidcontrol.1;. + References: &man.stty.1;, &man.vidcontrol.1;. + - + + Using type 1 fonts with X11 - -Using type 1 fonts with X11 + X11 can use either the .pfa or the + .pfb format fonts. The X11 fonts are + located in various subdirectories under + /usr/X11R6/lib/X11/fonts. Each font file + is cross referenced to its X11 name by the contents of the + fonts.dir file in each directory. -X11 can use either the .pfa or the -.pfb format fonts. The X11 fonts are located in -various subdirectories under -/usr/X11R6/lib/X11/fonts. Each font file is -cross referenced to its X11 name by the contents of the -fonts.dir file in each directory. + There is already a directory named Type1. The + most straight forward way to add a new font is to put it into + this directory. A better way is to keep all new fonts in a + separate directory and use a symbolic link to the additional + font. This allows one to more easily keep track of ones fonts + without confusing them with the fonts that were originally + provided. For example: -There is already a directory named Type1. The most -straight forward way to add a new font is to put it into this -directory. A better way is to keep all new fonts in a separate -directory and use a symbolic link to the additional font. This -allows one to more easily keep track of ones fonts without confusing -them with the fonts that were originally provided. For -example: - - -Create a directory to contain the font files + + Create a directory to contain the font files bash$ mkdir -p /usr/local/share/fonts/type1 bash$ cd /usr/local/share/fonts/type1 @@ -292,16 +315,17 @@ bash$ cp /cdrom/fonts/atm/showboat/showboat.pfb . bash$ cp /cdrom/fonts/atm/showboat/showboat.afm . Maintain an index to cross reference the fonts -bash$ echo showboat - InfoMagic CICA, Dec 1994, /fonts/atm/showboat >>INDEX - - -Now, to use a new font with X11, one must make the font file -available and update the font name files. The X11 font names look -like: - - --bitstream-charter-medium-r-normal-xxx-0-0-0-0-p-0-iso8859-1 - | | | | | | | | | | | | \ \ +bash$ echo showboat - InfoMagic CICA, Dec 1994, /fonts/atm/showboat >>INDEX + + + + Now, to use a new font with X11, one must make the font file + available and update the font name files. The X11 font names + look like: + + + -bitstream-charter-medium-r-normal-xxx-0-0-0-0-p-0-iso8859-1 + | | | | | | | | | | | | \ \ | | | | | \ \ \ \ \ \ \ +----+- character set | | | | \ \ \ \ \ \ \ +- average width | | | | \ \ \ \ \ \ +- spacing @@ -310,18 +334,18 @@ like: | | | \ \ \ \ +- points | | | \ \ \ +- pixels | | | \ \ \ - foundry family weight slant width additional style - - -A new name needs to be created for each new font. If you have -some information from the documentation that accompanied the font, -then it could serve as the basis for creating the name. If there is -no information, then you can get some idea by using -&man.strings.1; on the font -file. For example: - - -bash$ strings showboat.pfb | more + foundry family weight slant width additional style + + + + A new name needs to be created for each new font. If you + have some information from the documentation that accompanied + the font, then it could serve as the basis for creating the + name. If there is no information, then you can get some idea by + using &man.strings.1; on the font file. For example: + + + bash$ strings showboat.pfb | more %!FontType1-1.0: Showboat 001.001 %%CreationDate: 1/15/91 5:16:03 PM %%VMusage: 1024 45747 @@ -345,87 +369,110 @@ FontDirectory/Showboat known{/Showboat findfont dup/UniqueID known{dup 1991 by David Rakowski. Alle Rechte Vorbehalten.) readonly def end readonly def /FontName /Showboat def ---stdin-- - - -Using this information, a possible name might be: - - --type1-Showboat-medium-r-normal-decorative-0-0-0-0-p-0-iso8859-1 - - -The components of our name are: - - +--stdin-- + + -Foundry - -Lets just name all the new fonts type1. - - + Using this information, a possible name might be: -Family - -The name of the font. - - + + -type1-Showboat-medium-r-normal-decorative-0-0-0-0-p-0-iso8859-1 + + -Weight - -Normal, bold, medium, semibold, etc. From the -strings1 output -above, it appears that this font has a weight of -medium. - - + The components of our name are: -Slant - -roman, italic, oblique, -etc. Since the ItalicAngle is zero, -roman will be used. - - + + + Foundry -Width - -Normal, wide, condensed, extended, etc. Until it can be examined, -the assumption will be normal. - - + + Lets just name all the new fonts + type1. + + -Additional style - -Usually omitted, but this will indicate that -the font contains decorative capital letters. - - + + Family -Spacing - -proportional or monospaced. Proportional -is used since isFixedPitch is false. - - + + The name of the font. + + - - -All of these names are arbitrary, but one should strive to be -compatible with the existing conventions. A font is referenced by -name with possible wild cards by an X11 program, so the name chosen -should make some sense. One might begin by simply using - -…-normal-r-normal-…-p-… - -as the name, and then use -xfontsel1 to examine it -and adjust the name based on the appearance of the font. + + Weight -So, to complete our example: - - -Make the font accessible to X11 + + Normal, bold, medium, semibold, etc. From the + strings1 + output above, it appears that this font has a weight of + medium. + + + + + Slant + + + roman, italic, oblique, etc. Since the + ItalicAngle is zero, + roman will be used. + + + + + Width + + + Normal, wide, condensed, extended, etc. Until it can + be examined, the assumption will be + normal. + + + + + Additional style + + + Usually omitted, but this will indicate that the font + contains decorative capital letters. + + + + + Spacing + + + proportional or monospaced. + Proportional is used since + isFixedPitch is false. + + + + + All of these names are arbitrary, but one should strive to + be compatible with the existing conventions. A font is + referenced by name with possible wild cards by an X11 program, + so the name chosen should make some sense. One might begin by + simply using + + + …-normal-r-normal-…-p-… + + + + as the name, and then use + xfontsel1 to + examine it and adjust the name based on the appearance of the + font. + + So, to complete our example: + + + Make the font accessible to X11 bash$ cd /usr/X11R6/lib/X11/fonts/Type1 bash$ ln -s /usr/local/share/fonts/type1/showboat.pfb . @@ -449,29 +496,28 @@ bash$ cp fonts.dir fonts.scale bash$ xset fp rehash Examine the new font -bash$ xfontsel -pattern -type1-* - - -References: -&man.xfontsel.1;, -&man.xset.1;, -The X Windows System in a Nutshell, O'Reilly & Associates. +bash$ xfontsel -pattern -type1-* + + - + References: &man.xfontsel.1;, &man.xset.1;, The X + Windows System in a Nutshell, O'Reilly & + Associates. + - -Using type 1 fonts with Ghostscript + + Using type 1 fonts with Ghostscript -Ghostscript references a font via its Fontmap -file. This must be modified in a similar way to the X11 -fonts.dir file. Ghostscript can use either the -.pfa or the .pfb format -fonts. Using the font from the previous example, here is how to use -it with Ghostscript: - - -Put the font in Ghostscript's font directory + Ghostscript references a font via its Fontmap + file. This must be modified in a similar way to the X11 + fonts.dir file. Ghostscript can use either + the .pfa or the .pfb + format fonts. Using the font from the previous example, here is + how to use it with Ghostscript: + + + Put the font in Ghostscript's font directory bash$ cd /usr/local/share/ghostscript/fonts bash$ ln -s /usr/local/share/fonts/type1/showboat.pfb . @@ -497,46 +543,49 @@ Loading Showboat font from /usr/local/share/ghostscript/fonts/showboat.pfb... >>showpage, press <return> to continue<< >>showpage, press <return> to continue<< >>showpage, press <return> to continue<< -GS>quit - - -References: fonts.txt in the Ghostscript -4.01 distribution +GS>quit + + - + References: fonts.txt in the + Ghostscript 4.01 distribution + - -Using type 1 fonts with Groff + + Using type 1 fonts with Groff -Now that the new font can be used by both X11 and Ghostscript, -how can one use the new font with groff? First of all, since we are -dealing with type 1 postscript fonts, the groff device that is -applicable is the ps device. A font file must be -created for each font that groff can use. A groff font name is just -a file in /usr/share/groff_font/devps. With our -example, the font file could be -/usr/share/groff_font/devps/SHOWBOAT. The file -must be created using tools provided by groff. + Now that the new font can be used by both X11 and + Ghostscript, how can one use the new font with groff? First of + all, since we are dealing with type 1 postscript fonts, the + groff device that is applicable is the ps + device. A font file must be created for each font that groff + can use. A groff font name is just a file in + /usr/share/groff_font/devps. With our + example, the font file could be + /usr/share/groff_font/devps/SHOWBOAT. The + file must be created using tools provided by groff. -The first tool is afmtodit. 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: - - -bash$ cp /usr/src/gnu/usr.bin/groff/afmtodit/afmtodit.pl /tmp + The first tool is afmtodit. 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: + + + bash$ cp /usr/src/gnu/usr.bin/groff/afmtodit/afmtodit.pl /tmp bash$ ex /tmp/afmtodit.pl :1c #!/usr/bin/perl -P- . -:wq - - -This tool will create the groff font file from the metrics file -(.afm suffix.) Continuing with our -example: - - -Many .afm files are in Mac format&hellip ^M delimited lines +:wq + + + + This tool will create the groff font file from the metrics + file (.afm suffix.) Continuing with our + example: + + + Many .afm files are in Mac format&hellip ^M delimited lines We need to convert them to unix style ^J delimited lines bash$ cd /tmp bash$ cat /usr/local/share/fonts/type1/showboat.afm | @@ -544,33 +593,37 @@ bash$ cat /usr/local/share/fonts/type1/showboat.afm | Now create the groff font file bash$ cd /usr/share/groff_font/devps -bash$ /tmp/afmtodit.pl -d DESC -e text.enc /tmp/showboat.afm generate/textmap SHOWBOAT - - -The font can now be referenced with the name SHOWBOAT. - -If ghostscript is used to drive the printers on the system, -then nothing more needs to be done. However, if true postscript -printers are used, then the font must be down loaded 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 down loadable font. The pfbtops tool -is used to create the .pfa format of the font, -and the download file is modified to reference the new -font. The download file must reference the internal -name of the font. This can easily be determined from the groff font -file as illustrated: - - -Create the .pfa font file -bash$ pfbtops /usr/local/share/fonts/type1/showboat.pfb >showboat.pfa - - -Of course, if the .pfa file is already -available, just use a symbolic link to reference it. - - -Get the internal font name +bash$ /tmp/afmtodit.pl -d DESC -e text.enc /tmp/showboat.afm generate/textmap SHOWBOAT + + + + The font can now be referenced with the name + SHOWBOAT. + + If ghostscript is used to drive the printers on the system, + then nothing more needs to be done. However, if true postscript + printers are used, then the font must be down loaded 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 down loadable font. + The pfbtops tool is used to create the + .pfa format of the font, and the + download file is modified to reference the new + font. The download file must reference the + internal name of the font. This can easily be determined from + the groff font file as illustrated: + + + Create the .pfa font file +bash$ pfbtops /usr/local/share/fonts/type1/showboat.pfb >showboat.pfa + + + + Of course, if the .pfa file is already + available, just use a symbolic link to reference it. + + + Get the internal font name bash$ fgrep internalname SHOWBOAT internalname Showboat @@ -579,13 +632,14 @@ bash$ ex download :$a Showboat showboat.pfa . -:wq - - -To test the font: - - -bash$ cd /tmp +:wq + + + + To test the font: + + + bash$ cd /tmp bash$ cat >example.t <<EOF .sp 5 .ps 16 @@ -618,16 +672,14 @@ bash$ groff -Tps example.t >example.ps bash$ ghostview example.ps To print it -bash$ lpr -Ppostscript example.ps - - -References: -/usr/src/gnu/usr.bin/groff/afmtodit/afmtodit.man, -&man.groff.font.5;, -&man.groff.char.7;, -&man.pfbtops.1;. - - +bash$ lpr -Ppostscript example.ps + + + + References: + /usr/src/gnu/usr.bin/groff/afmtodit/afmtodit.man, + &man.groff.font.5;, &man.groff.char.7;, &man.pfbtops.1;. + Converting TrueType fonts to a groff/postscript format for @@ -635,23 +687,23 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> <para>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:</para> + base system. They are:</para> <variablelist> <varlistentry> <term><command>ttf2pf</command></term> <listitem> - <para>TrueType to postscript convertsion utilities. This + <para>TrueType to postscript convertsion utilities. This allows conversion of a TrueType font to an ascii font metric (<filename>.afm</filename>) file.</para> - + <para>Currently available at <ulink - url="http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf/">http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf</ulink>. + url="http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf/">http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf</ulink>. Note: These files are postscript programs and must be downloaded to disk by holding down the - <keycap>Shift</keycap> key when clicking on the - link. Otherwise, your browser may try to launch + <keycap>Shift</keycap> key when clicking on the link. + Otherwise, your browser may try to launch <application>ghostview</application> to view them.</para> <para>The files of interest are:</para> @@ -673,8 +725,8 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> <para>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 + 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 ghostscript distribution, but it's just as easy to use these as an isolated utility. FreeBSD doesn't seem to @@ -689,7 +741,7 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> <listitem> <para>Creates font files for use with groff from ascii font - metrics file. This usually resides in the directory, + metrics file. This usually resides in the directory, <filename>/usr/src/contrib/groff/afmtodit</filename>, and requires some work to get going.</para> @@ -700,11 +752,10 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> location.</para> </note> - <para>In the work area, you'll need to make the - utility. Just type:</para> + <para>In the work area, you'll need to make the utility. + Just type:</para> - <screen> -<prompt>#</prompt> <userinput>make -f Makefile.sub afmtodit</userinput> + <screen><prompt>#</prompt> <userinput>make -f Makefile.sub afmtodit</userinput> </screen> <para>You may also need to copy @@ -724,8 +775,7 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> <para>Create the <filename>.afm</filename> file by typing:</para> - <screen> -<prompt>%</prompt> <userinput>gs <optional>-dNODISPLAY</optional> <optional>-q</optional> -- ttf2pf.ps <replaceable>TTF_name</replaceable> <optional><replaceable>PS_font_name</replaceable> <optional><replaceable>AFM_name</replaceable></optional></optional></userinput> + <screen><prompt>%</prompt> <userinput>gs <optional>-dNODISPLAY</optional> <optional>-q</optional> -- ttf2pf.ps <replaceable>TTF_name</replaceable> <optional><replaceable>PS_font_name</replaceable> <optional><replaceable>AFM_name</replaceable></optional></optional></userinput> </screen> <para>Where, <replaceable>TTF_name</replaceable> is your @@ -739,15 +789,14 @@ bash$ <userinput>lpr -Ppostscript example.ps</></screen> <para>This also produces a <filename>.pfa</filename> file, the ascii postscript font metrics file - (<filename>.pfb</filename> is for the binrary form). This + (<filename>.pfb</filename> is for the binrary form). This won't be needed, but could (I think) be useful for a fontserver.</para> <para>For example, to convert the 30f9 Barcode font using the default file names, use the following command:</para> - <screen> -<prompt>%</prompt> <userinput>gs -dNODISPLAY -- ttf2pf.ps 3of9.ttf</userinput> + <screen><prompt>%</prompt> <userinput>gs -dNODISPLAY -- ttf2pf.ps 3of9.ttf</userinput> 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. @@ -758,8 +807,7 @@ Converting 3of9.ttf to 3of9.pfa and 3of9.afm. <filename>A.pfa</filename> and <filename>B.afm</filename>, then use this command:</para> - <screen> -<prompt>%</prompt> <userinput>gs -dNODISPLAY -- ttf2pf.ps 3of9.ttf A B</userinput> + <screen><prompt>%</prompt> <userinput>gs -dNODISPLAY -- ttf2pf.ps 3of9.ttf A B</userinput> 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. @@ -772,16 +820,15 @@ Converting 3of9.ttf to A.pfa and B.afm. <para>Change directories to <filename>/usr/share/groff_font/devps</filename> so as to - make the following command easier to execute. You'll - probably need root priviledges for this. (Or, if you're + make the following command easier to execute. You'll + probably need root priviledges for this. (Or, if you're paranoid about working there, make sure you reference the files <filename>DESC</filename>, <filename>text.enc</filename> and <filename>generate/textmap</filename> as being in this directory.)</para> - <screen> -<prompt>%</prompt> <userinput>afmtodit -d DESC -e text.enc file.afm \ + <screen><prompt>%</prompt> <userinput>afmtodit -d DESC -e text.enc file.afm \ generate/textmap <replaceable>PS_font_name</replaceable></userinput> </screen> @@ -790,14 +837,12 @@ Converting 3of9.ttf to A.pfa and B.afm. <command>ttf2pf.ps</command> above, and <replaceable>PS_font_name</replaceable> is the font name used from that command, as well as the name that - &man.groff.1; - will use for references to this font. For example, assuming - you used the first <command>tiff2pf.ps</command> command - above, then the 3of9 Barcode font can be created using the - command:</para> + &man.groff.1; will use for references to this font. For + example, assuming you used the first + <command>tiff2pf.ps</command> command above, then the 3of9 + Barcode font can be created using the command:</para> - <screen> -<prompt>%</prompt> <userinput>afmtodit -d DESC -e text.enc 3of9.afm \ + <screen><prompt>%</prompt> <userinput>afmtodit -d DESC -e text.enc 3of9.afm \ generate/textmap 3of9</userinput> </screen> @@ -814,137 +859,146 @@ Converting 3of9.ttf to A.pfa and B.afm. <filename>.afm</filename> file prior to running <command>afmtodit</command>. This name must also match the one used in the Fontmap file if you wish to pipe - &man.groff.1; into - &man.gs.1;.</para> + &man.groff.1; into &man.gs.1;.</para> </listitem> </orderedlist> </sect1> -<sect1> -<title>Can TrueType fonts be used with other programs? + + Can TrueType fonts be used with other programs? -The TrueType font format is used by Windows, Windows 95, and -Mac's. It is quite popular and there are a great number of -fonts available in this format. + The TrueType font format is used by Windows, Windows 95, and + Mac's. It is quite popular and there are a great number of + fonts available in this format. -Unfortunately, there are few applications that I am aware of -that can use this format: Ghostscript and Povray come to mind. -Ghostscript's support, according to the documentation, is rudimentary -and the results are likely to be inferior to type 1 fonts. -Povray version 3 also has the ability to use TrueType fonts, but -I rather doubt many people will be creating documents as a series of -raytraced pages :-). + Unfortunately, there are few applications that I am aware of + that can use this format: Ghostscript and Povray come to mind. + Ghostscript's support, according to the documentation, is + rudimentary and the results are likely to be inferior to type 1 + fonts. Povray version 3 also has the ability to use TrueType + fonts, but I rather doubt many people will be creating documents + as a series of raytraced pages :-). -This rather dismal situation may soon change. -The FreeType Project -is currently developing a useful set of FreeType tools: - - - -The xfsft font server for X11 can serve -TrueType fonts in addition to regular fonts. Though currently in -beta, it is said to be quite useable. See Juliusz -Chroboczek's page for further information. Porting instructions -for FreeBSD can be found at Stephen Montgomery's -software page. - - - -xfstt is another font -server for X11, available under -ftp://sunsite.unc.edu/pub/Linux/X11/fonts. - - -A program called ttf2bdf can produce -BDF files suitable for use in an X environment from TrueType files. Linux -binaries are said to be available from ftp://crl.nmsu.edu/CLR/multiling/General/. - - - - -For people requiring the use of Asian TrueType fonts, the -XTT font server may be worth a look. Information about -XTT can be found at URL: http://hawk.ise.chuo-u.ac.jp/student/person/tshiozak/study/freebsd-at-random/x-tt/index-en.html. - - - -and others … - - - -The -FreeType Projects page - is a good starting point for information on these and other -free TrueType projects. - - + This rather dismal situation may soon change. The FreeType Project is + currently developing a useful set of FreeType tools: - -Where can additional fonts be obtained? + + + The xfsft font server for X11 can + serve TrueType fonts in addition to regular fonts. Though + currently in beta, it is said to be quite useable. See + Juliusz + Chroboczek's page for further information. + Porting instructions for FreeBSD can be found at Stephen + Montgomery's software page. + -Many fonts are available on the Internet. They are either -entirely free, or are share-ware. In addition, there are many -inexpensive CDROMs available that contain many fonts. Some Internet -locations (as of August 1996) are: - - + + xfstt is another font server for X11, + available under + ftp://sunsite.unc.edu/pub/Linux/X11/fonts. + -ftp://ftp.winsite.com (Formerly -CICA) + + A program called ttf2bdf can produce + BDF files suitable for use in an X environment from TrueType + files. Linux binaries are said to be available from ftp://crl.nmsu.edu/CLR/multiling/General/. + -http://www.simtel.net/simcgi-bin/dosfind.cgi + + For people requiring the use of Asian TrueType fonts, + the XTT font server may be worth a look. + Information about XTT can be found at + URL: http://hawk.ise.chuo-u.ac.jp/student/person/tshiozak/study/freebsd-at-random/x-tt/index-en.html. + -ftp://ftp.coast.net/ + + and others … + + -http://af-pc-plloyd.ecel.uwa.edu.au/fonts/index.html + The FreeType Projects + page is a good starting point for information on + these and other free TrueType projects. + -http://www.esselte.com/letraset/index.html + + Where can additional fonts be obtained? -http://www.inil.com/users/elfring/esf.htm + Many fonts are available on the Internet. They are either + entirely free, or are share-ware. In addition, there are many + inexpensive CDROMs available that contain many fonts. Some + Internet locations (as of August 1996) are: - - - + + + ftp://ftp.winsite.com + (Formerly CICA) + - -Additional questions + + http://www.simtel.net/simcgi-bin/dosfind.cgi + - + + ftp://ftp.coast.net/ + - -What use are the .pfm files? - + + http://af-pc-plloyd.ecel.uwa.edu.au/fonts/index.html + - -Can one generate the .afm file from a .pfa or .pfb? - + + http://www.esselte.com/letraset/index.html + - -How to generate the groff character mapping files for postscript fonts -with non-standard character names? - + + http://www.inil.com/users/elfring/esf.htm + + + - -Can xditview and devX?? devices be setup to access all the new fonts? - + + Additional questions - -It would be good to have examples of using TrueType fonts with povray and -ghostscript. - + + + What use are the .pfm files? + - - - + + Can one generate the .afm file from + a .pfa or + .pfb? + + + + How to generate the groff character mapping files for + postscript fonts with non-standard character names? + + + + Can xditview and devX?? devices be setup to access all + the new fonts? + + + + It would be good to have examples of using TrueType + fonts with povray and ghostscript. + + +