\\$1
.. ..
.... ''' ''' ''' Set up \*(-- to give an unbreakable dash; ''' string Tr holds user defined translation string. ''' Bell System Logo is used as a dummy character. ''' .tr \(*W-|\(bv\*(Tr ''' \*(M", \*(S", \*(N" and \*(T" are the equivalent of ''' \*(L" and \*(R", except that they are used on ".xx" lines, ''' such as .IP and .SH, which do another additional levels of ''' double-quote interpretation 'br\} .tr \*(Tr 'br\} If the F register is turned on, we'll generate
index entries out stderr for the following things:
TH Title
SH Header
Sh Subsection
Ip Item
X<> Xref (embedded
Of course, you have to process the output yourself
in some meaninful fashion.
.tm Index:\\$1\t\\n%\t"\\$2" .. .nr % 0 .rr F .\}
. \" AM - accent mark definitions .bd B 3 . \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds ? ? . ds ! ! . ds / . ds q .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10' . ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' . ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds v \h'-1'\o'\(aa\(ga' . ds _ \h'-1'^ . ds . \h'-1'. . ds 3 3 . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE . ds oe oe . ds Oe OE .\}
If the configuration file is not specified as an argument then the file `convert.cfg\*(R' in the current directory is used. This file contains a set of configuration variables. The distribution contains a sample file file `convert.cfg.sample\*(R'. Please copy it to `convert.cfg\*(R', look inside it and change the configuration variables. The more stable configuration variables, such as the path names of the scripts and encoding files are located in `convert\*(R' itself, they are automatically updated when installing ttf2pt1.
Put all the TTF fonts you want to convert into some directory (this may be just the directory that already contains all the Windows fonts on a mounted FAT filesystem). If you have fonts in different source encoding then put the fonts in each of the encodings into a separate directory. Up to 10 source directories are supported. If you (in a rather unlikely case) have more source directories then you can make two separate runs of the converter, converting up to 10 directories at a time.
The variables in the configuration file are: p "\(bu" 2 SRCDIRS - the list of directories (with absolute paths) with \s-1TTF\s0 fonts. Each line contains at least 3 fields: the name of the directory, the language of the fonts in it (if you have fonts for different languages you have to put them into the separate directories) and the encoding of the fonts. Again, if you have some of the \s-1TTF\s0 typefaces in one encoding, and some in another (say, \s-1CP\s0-1251 and \s-1KOI\s0-8), you have to put them into the separate source directories. Some lines may contain 4 fields. Then the fourth field is the name of the external map to convert the Unicode fonts into the desirable encoding. This map is used instead of the built-in map for the specified language. .Sp *8* An interesting thing is that some languages have more than one widely used character encodings. For example, the widely used encodings for Russian are \s-1IBM\s0 \s-1CP\s0-866 (\s-1MS\s0-\s-1DOS\s0 and Unix), \s-1KOI\s0-8 (Unix and \s-1VAX\s0, also the standard Internet encoding), \s-1IBM\s0 \s-1CP\s0-1251 (\s-1MS\s0 Windows). That's why I have provided the means to generate the converted fonts in more than one encoding. See the file encodings/\s-1README\s0 for details about the encoding tables. Actually, if you plan to use these fonts with Netscape Navigator better use the aliases cp-866 instead of ibm-866 and windows-1251 instead of ibm-1251 because that's what Netscape wants. p "\(bu" 2 DSTDIR - directory for the resulting Type1 fonts. Be careful! This directory gets completely wiped out before conversion, so don't use any already existing directory for this purpose. p "\(bu" 2 DSTENC{language} - the list of encodings in which the destination fonts will be generated for each language. Each font of that language will be generated in each of the specified encodings. If you don't want any translation, just specify both SRCENC and DSTENC as iso8859-1 (or if you want any other encoding specified in the fonts.dir, copy the description of 8859-1 with new name and use this new name for SRCENC and DSTENC). p "\(bu" 2 FOUNDRY - the foundry name to be used in the fonts.dir file. I have set it to `fromttf\*(R' to avoid name conflicts with any existing font for sure. But this foundry name is not registered in X11 standards and if you want to get the full standard compliance or have a font server that enforces such a compliance, use `misc\*(R'.
The next few parameters control the general behavior of the converter. They default values are set to something reasonable. p "\(bu" 2 CORRECTWIDTH - if the value is set to YES then use the converter option -w, otherwise don't use it. See the description of this option in the \s-1README\s0 file. p "\(bu" 2 REMOVET1A - if the value is set to YES then after conversion remove the un-encoded .t1a font files and the intermediate .xpfa font metric files. p "\(bu" 2 INSTALLFONTMAP - a Ghostscript parameter, if the value is set to YES then install the entries for the new fonts right into the main Fontmap file. Otherwise just leave the file Fontmap.ttf in the Ghostscript configuration directory. p "\(bu" 2 HINTSUBST - if the value is set to YES use the option -H, otherwise don't use it. This option enables the hint substitution technique. If you have not installed the X11 patch described above, use this option with great caution. See further description of this option in the \s-1README\s0 file. p "\(bu" 2 ENFORCEISO - if the value is set to YES then disguise the resulting fonts as the fonts in ISOLatin1 encoding. Historically this was neccessary due to the way the installer scripts created the X11 font configuration files. It is not neccessary any more for this purpose. But if you plan to use these fonts with some other application that expects ISOLatin1 encoding then better enable this option. p "\(bu" 2 ALLGLYPHS - if the value is set to YES then include all the glyphs from the source fonts into the resulting fonts, even if these glyphs are inaccessible. If it's set to NO then include only the glyphs which have codes assigned to them. The glyphs without codes can not be used directly. But some clever programs, such as the Type 1 library from XFree86 3.9 and higher can change the encoding on the fly and use another set of glyphs. If you have not installed the X11 patch described above, use this option with great caution. See further description of the option option -a in the \s-1README\s0 file. p "\(bu" 2 GENUID - if the value is set to YES then use the option -uA of the converter to generate UniqueIDs for the converted fonts. The standard X11 Type 1 library does not use this \s-1ID\s0, so it may only be neccessary for the other applications. The script is clever enough to generate different UniqueID for the same font converted to multiple encodings. Also after conversion it checks all the fonts generacted during the session for duplicated UniqueID and shows those. Still, this does not quarantee that these UniqueIDs won't overlap with some other fonts. The UniqueIDs are generated as hash values from the font names, so it's guaranteed that if the `convert\*(R' script runs multiple times it will generate the same UniqueIDs during each run. See further description of this option in the \s-1README\s0 file. p "\(bu" 2 GENUID - if the value is set to YES then create the .pfb files, otherwise the .pfa files. The .pfb files are more compact but contain binary data, so you may experience some troubles when transferring them through the network.
The following parameters are used to locate the other scripts and configuration files. By default the scripts do a bit of guessing for them: they search in the ttf2pt1 installation directory if ttf2pt1 was installed or otherwise suppose that you are running `convert\*(R' with `scripts\*(R' subdirectory being the current directory. p "\(bu" 2 ENCDIR - directory containing the descriptions of encodings p "\(bu" 2 MAPDIR - directory containing the external map files
Besides that a few parameters are built into the `convert\*(R' script itself. You probably won't need to change them: p "\(bu" 2 T1ASM, TTF2PT1, TRANS, T1FDIR, FORCEISO - paths to the other script
Also there are a few parameters controlling the installation of fonts for Ghostscript. Please look at their description in the Ghostscript section of documentation or in the ttf2pt1_x2gs(1) manual page before running `convert\*(R'. If these parameters are set, `convert\*(R' will call the `x2gs\*(R' script automatically to install the newly converted fonts in Ghostscript.
After creating the configuration file run the `convert\*(R' script. Look at the result and the log file in DSTDIR.
Add the directory with newly converted fonts to the configuration of X server or font server. For most of the systems this step is very straightforward. For \s-1HP\s0-\s-1UX\s0 it's rather tricky and poorly documented, so the file \s-1FONTS\s0.hpux gives a short description.
If you don't have the privileges of the root user, you still can configure your private font server. Just use some non-standard port number (see \s-1FONTS\s0.hpux for an example, exept that you won't need all the \s-1HP\s0-related stuff on any other system).