diff --git a/en_US.ISO8859-1/articles/fonts/article.xml b/en_US.ISO8859-1/articles/fonts/article.xml index fc3932f2ee..1c9f5a2492 100644 --- a/en_US.ISO8859-1/articles/fonts/article.xml +++ b/en_US.ISO8859-1/articles/fonts/article.xml @@ -23,14 +23,21 @@ updated to reflect changes in FreeBSD system configuration files by Mark Ovens 27/5/00 --> -
- Fonts and FreeBSDA Tutorial - +
+ + Fonts and FreeBSD - + A Tutorial - DaveBodenstab + + + Dave + Bodenstab + +
imdave@synet.net
@@ -54,10 +61,12 @@ 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. + 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.
@@ -73,14 +82,15 @@ - Basic terminology + Basic Terminology 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 @@ -126,7 +136,10 @@ - .fon, .fnt + + .fon, + .fnt + Bitmapped screen fonts @@ -134,7 +147,7 @@ - The .fot file is used by &windows; as + The .fot 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 @@ -142,7 +155,7 @@ - What font formats can I use? + 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 @@ -225,16 +238,16 @@ 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 &ms-dos;/&windows; environment. I have not + may not be the same format as a .fnt one + encounters in the &ms-dos;/&windows; environment. I have not made any attempt at using other .fnt files other than those provided with FreeBSD. - Setting a virtual console to 80x60 line mode + Setting a Virtual Console to 80x60 Line Mode - First, an 8x8 font must be loaded. To do this, + First, an 8x8 font must be loaded. To do this, /etc/rc.conf should contain the line (change the font name to an appropriate one for your locale): @@ -252,40 +265,43 @@ Various screen-oriented programs, such as &man.vi.1;, must be able to determine the current screen dimensions. As this is - achieved this through ioctl calls to the console - driver (such as &man.syscons.4;) they will correctly determine the new - screen dimensions. + achieved this through ioctl calls to the + console driver (such as &man.syscons.4;) they will correctly + determine the new screen dimensions. To make this more seamless, one can embed these commands in the startup scripts so it takes place when the system boots. - To do this is add this line to /etc/rc.conf - + To do this is add this line to + /etc/rc.conf. - - allscreens_flags="VGA_80x60" # Set this vidcontrol mode for all virtual screens - - + + allscreens_flags="VGA_80x60" # Set this vidcontrol mode for all virtual screens + References: &man.rc.conf.5;, &man.vidcontrol.1;. - Using type 1 fonts with <application>X11</application> + Using Type 1 Fonts with + <application>X11</application> - X11 can use either the .pfa or the - .pfb format fonts. The X11 fonts are - located in various subdirectories under + 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. + is cross referenced to its X11 name + by the contents of fonts.dir 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 @@ -302,9 +318,10 @@ &prompt.user; 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: + 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 @@ -395,7 +412,9 @@ end readonly def Slant - roman, italic, oblique, etc. Since the + roman, italic, oblique, etc. Since the ItalicAngle is zero, roman will be used. @@ -433,9 +452,9 @@ end readonly def 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 + 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-… @@ -477,19 +496,23 @@ showboat.pfb -type1-showboat-medium-r-normal-decorative-0-0-0-0-p-0-iso8859-1 References: &man.xfontsel.1;, &man.xset.1;, The X - Windows System in a Nutshell, O'Reilly & + 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 + Ghostscript references a font via + its Fontmap. This must be modified in + a similar way to the X11 + fonts.dir. + 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: + how to use it with + Ghostscript: Put the font in Ghostscript's font directory @@ -526,19 +549,23 @@ GS>quit - 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 + 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 + 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. + 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 @@ -554,9 +581,9 @@ GS>quit :wq - This tool will create the groff font file from the metrics - file (.afm suffix.) Continuing with our - example: + 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… ^M delimited lines @@ -573,25 +600,25 @@ We need to convert them to &unix; style ^J delimited lines 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 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 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: + 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 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 pfbtops tool is + used to create the .pfa format of the font, + and download is modified to + reference the new font. The download + 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 &prompt.user; pfbtops /usr/local/share/fonts/type1/showboat.pfb >showboat.pfa - Of course, if the .pfa file is already + Of course, if .pfa is already available, just use a symbolic link to reference it. @@ -652,7 +679,7 @@ EOF - Converting TrueType fonts to a groff/PostScript format for + <title>Converting TrueType Fonts to a groff/PostScript Format For groff This potentially requires a bit of work, simply because it @@ -668,12 +695,13 @@ EOF allows conversion of a TrueType font to an ascii font metric (.afm) file. - Currently available at http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf/. + Currently available at http://sunsite.icm.edu.pl/pub/GUST/contrib/BachoTeX98/ttf2pf/. Note: These files are PostScript programs and must be - downloaded to disk by holding down the - Shift key when clicking on the link. - Otherwise, your browser may try to launch - ghostview to view them. + downloaded to disk by holding down Shift + when clicking on the link. Otherwise, your browser may + try to launch ghostview to view + them. The files of interest are: @@ -697,10 +725,10 @@ EOF upper case, so any renaming must be consistent with this. (Actually, GS_TTF.PS and PFS2AFM.PS are supposedly part of the - Ghostscript 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 + Ghostscript 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 /usr/local/share/groff_font/devps(?). @@ -709,13 +737,14 @@ EOF afmtodit - Creates font files for use with groff from ascii font - metrics file. This usually resides in the directory, + Creates font files for use with + groff from ascii font metrics + file. This usually resides in the directory, /usr/src/contrib/groff/afmtodit, and requires some work to get going. - If you are paranoid about working in the + If you are paranoid about working in the /usr/src tree, simply copy the contents of the above directory to a work location. @@ -740,21 +769,20 @@ EOF - Create the .afm file by - typing: + Create .afm by typing: % gs -dNODISPLAY -q -- ttf2pf.ps TTF_name PS_font_name AFM_name Where, TTF_name is your TrueType font file, PS_font_name - is the file name for the .pfa file, + is the file name for .pfa, AFM_name is the name you wish for - the .afm file. If you do not specify + .afm. If you do not specify output file names for the .pfa or .afm files, then default names will be generated from the TrueType font file name. - This also produces a .pfa file, the + This also produces a .pfa, the ascii PostScript font metrics file (.pfb is for the binary form). This will not be needed, but could (I think) be useful for a @@ -781,7 +809,8 @@ Converting 3of9.ttf to A.pfa and B.afm. - Create the groff PostScript file: + Create the groff PostScript + file: Change directories to /usr/share/groff_font/devps so as to @@ -802,11 +831,11 @@ Converting 3of9.ttf to A.pfa and B.afm. 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 - tiff2pf.ps command above, then the 3of9 + tiff2pf.ps above, then the 3of9 Barcode font can be created using the command: % afmtodit -d DESC -e text.enc 3of9.afm generate/textmap 3of9 - + Ensure that the resulting PS_font_name file (e.g., 3of9 in the example above) is located @@ -817,7 +846,7 @@ Converting 3of9.ttf to A.pfa and B.afm. Note that if ttf2pf.ps assigns a font name using the one it finds in the TrueType font file and you want to use a different name, you must edit the - .afm file prior to running + .afm prior to running afmtodit. This name must also match the one used in the Fontmap file if you wish to pipe &man.groff.1; into &man.gs.1;. @@ -826,7 +855,7 @@ Converting 3of9.ttf to A.pfa and B.afm. - 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 @@ -834,38 +863,43 @@ Converting 3of9.ttf to A.pfa and B.afm. 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 :-). + 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: + 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 usable. See - Juliusz - Chroboczek's page for further information. - Porting instructions for FreeBSD can be found at Stephen + 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 usable. 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/. + 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/. + files. Linux binaries are said to be available from ftp://crl.nmsu.edu/CLR/multiling/General/. @@ -875,7 +909,7 @@ Converting 3of9.ttf to A.pfa and B.afm. - Where can additional fonts be obtained? + Where Can Additional Fonts be Obtained? Many fonts are available on the Internet. They are either entirely free, or are share-ware. In addition many fonts are @@ -884,7 +918,7 @@ Converting 3of9.ttf to A.pfa and B.afm. - Additional questions + Additional Questions @@ -892,14 +926,15 @@ Converting 3of9.ttf to A.pfa and B.afm. - Can one generate the .afm file from + Can one generate the .afm from a .pfa or .pfb? - How to generate the groff character mapping files for - PostScript fonts with non-standard character names? + How to generate the groff + character mapping files for PostScript fonts with + non-standard character names? @@ -909,7 +944,8 @@ Converting 3of9.ttf to A.pfa and B.afm. It would be good to have examples of using TrueType - fonts with Povray and Ghostscript. + fonts with Povray and + Ghostscript.