📄 ttf2pk.doc
字号:
One feature missing in afm2tfm has been added which is needed by theLaTeX T1 encoding: ttf2tfm will construct the glyph `Germandbls' (bysimply concatenating to `S' glyphs) even for normal fonts if possible.It appears in the glyph list (written to stdout) as the last item,marked with an asterisk. Since this isn't a real glyph it will beavailable only in the virtual font.For both input and output encoding, an empty code position isrepresented by the glyph name `.notdef'.In encoding files, you can use `\' as the final character of a line toindicate that the input is continued on the next line. The backslashand the following newline character will be removed.ttf2tfm returns 0 on success and 1 on error; warning and errormessages are written to standard error.other options-------------You can select the font in a TrueType font collection (which usuallyhas the extension `.ttc') with `-f'; the default value, zero,specifies the first font. For fonts not being a collection thisparameter is ignored.The option `-l' makes ttf2tfm create ligatures in subfonts betweenfirst and second bytes of all the original character codes. Example:Character code 0xABCD maps to character position 123 in subfont 45.Then a ligature in subfont 45 between position 0xAB and 0xCD pointingto character 123 will be produced. The fonts of the Korean HLaTeXpackage use this feature. Note that this option generates correctligatures only for TrueType fonts where the input cmap is identical tothe output encoding. In case of HLaTeX, TTFs must have platform ID 3and encoding ID 5.Option `-L' is the same as `-l', but character codes for ligatures arespecified in a ligature file. For example, `-L KS-HLaTeX' generatescorrect ligatures for the Korean HLaTeX package regardless of theplatform and encoding ID of the used TrueType font (the file`KS-HLaTeX.sfd' is part of the ttf2pk package). Ligature files havethe same format and extension as SFD files. Both `-L'and `-l' areignored if not in subfont mode.PostScript encoding vectors containing glyph indices of subfonts,primarily used to embed TrueType fonts in pdfLaTeX, can be createdwith option `-w'. ttf2tfm takes the TFM names and replaces the suffixwith `.enc'; that is, for files `foo01.tfm', `foo02.tfm', ... itcreates `foo01.enc', `foo02.enc', ... at the same place.To produce glyphs rotated by 90 degrees counter-clockwise, use `-x'.If the font contains a GSUB table (with feature `vert') to specifyvertical glyph presentation forms, both ttf2pk and ttf2tfm will useit. This will work only in subfont mode. The y-offset of rotatedglyphs can be specified with the `-y' option; its parameter gives thefractional amount of shifting downwards (the unit is one EM). If notspecified, a value of 0.25 (em) is used.ttf2pk======Usage: ttf2pk [-q] [-n] FONT DPI ttf2pk -t [-q] FONTOptions:-q suppresses informational output-n only use `.pk' as extension-t test for FONT (returns 0 on success)--help print this message and exit--version print version number and exitThe FONT parameter must correspond to an entry in a map file recordedin the configuration file ttf2pk.cfg (see below for details),otherwise error code 2 is returned -- this can be used for scriptslike mktexpk to test whether the given font name is a (registered)TrueType font.Another possibility is to use the `-t' switch which will print theline of a map file corresponding to FONT and return 0 on success (`-q'suppresses any output).DPI specifies the intended resolution (we always assume a design sizeof 10pt).ttf2pk.cfg----------ttf2pk uses a small configuration file called ttf2pk.cfg; in each lineit contains a keyword with its value, separated by whitespace.Comment lines can start with any of the following characters: `*',`#', `;', and `%'. Leading whitespace is ignored.Currently, only one keyword, `map', is recognized in this file; ittakes a map file name as a parameter. If no extension is given to themap file name, `.map' is appended. No whitespace is allowed in themap file name. The `map' keyword can be given more than once tospecify multiple map files; if the map file name is prepended by aplus sign, it is added to the list of map files to be used. Example: map foo map +barThis makes ttf2pk to first read `foo.map', then `bar.map'.If the configuration file is not found, ttf2pk tries to use`ttfonts.map' instead.map files---------Parameters specified to ttf2tfm are preserved for ttf2pk in map files-- ttf2tfm writes out to standard output, as the last line, a properentry for a map file.As an example, a call to ttf2tfm arial -s 0.25 -P 1 -E 0 -r .g0xc7 caron \ -p 8r.enc -t T1-WGL4.enc -v arialsx arialswill produce the following line: arials arial Slant=0.25 Encoding=8r.enc Pid=1 Eid=0 .g0xc7=caronThe output encoding given with `-t' for the virtual font `arialsx' isimmaterial to ttf2pk (nevertheless, input encoding files must have thesame format as with ttf2tfm, and all said above about encoding filesholds).Here a table listing the various ttf2tfm parameters and itscorresponding entries in a map file: -s Slant -e Extend -p Encoding -f Fontindex -P Pid -E Eid -n PS=Yes -N PS=Only -R Replacement -x Rotate=Yes -y Y-OffsetSingle replacement glyph names given to ttf2tfm with the `-r' switchare directly specified with old-glyphname=new-glyphname. For subfontsor if no encoding file is given, replacement glyphs are ignored.One additional parameter in a map file is unique to ttf2pk: `Hinting',which can take the values `On' or `Off'. Some fonts (e.g. the CJKVpart of cyberbit.ttf) are rendered incorrectly if hinting isactivated. Default is `On' (you can also use `Yes', `No', `1', and`0').The format of map files is simple. Each line defines a font; firstcomes the TeX font name, then its TrueType font file name, followed bythe parameters in any order. Case is significant (even for parameternames); the parameters are separated from its values by an equal sign,with possible whitespace surrounding it. ttf2pk reads in a map fileline by line, continuing until the TeX font specified on the commandline is found, otherwise the programs exits with error code 2. Thusyou can use any character invalid in a TeX font name to start acomment line.In both map files and encoding files, use `\' as the final characterof a line to indicate that the input is continued on the next line.The backslash and the following newline character will be removed.ttf2pk will abort if it can't find and read the TeX font metrics fileof the given TeX font name.Subfont definition files========================CJKV (Chinese/Japanese/Korean/old Vietnamese) fonts usually containseveral thousand glyphs; to use them with TeX it is necessary to splitsuch large fonts into subfonts. Subfont definition files (usuallyhaving the extension `.sfd') are a simple means to do this smoothly.A subfont file name usually consists of a prefix, a subfont infix, anda postfix (which is empty in most cases), e.g. ntukai23 -> prefix: ntukai, infix: 23, postfix: (empty)Here the syntax of a line in an SFD file, describing one subfont. Thehash character `#' starts a comment; the remainder of the current lineis ignored. <whitespace> <infix> <whitespace> <ranges> <whitespace> `\n' <infix> := anything except whitespace. It's best to use only alphanumerical characters. <whitespace> := space, formfeed, carriage return, horizontal and vertical tabs -- no newline characters. <ranges> := <ranges> <whitespace> <codepoint> | <ranges> <whitespace> <range> | <ranges> <whitespace> <offset> <whitespace> <range> <codepoint> := <number> <range> := <number> `_' <number> <offset> := <number> `:' <number> := hexadecimal (prefix `0x'), decimal, or octal (prefix `0')A line can be continued on the next line with a backslash ending theline. The ranges must not overlap; offsets have to be in the range0-255.Example: The line 03 10: 0x2349 0x2345_0x2347 assigns to the code positions 10, 11, 12, and 13 of the subfont having the infix `03' the character codes 0x2349, 0x2345, 0x2346, and 0x2347, respectively.The SFD files in the distribution are customized for the CJK packagefor LaTeX.You have to embed the SFD file into the TFM font name (at the placewhere the infix will appear) surrounded by two `@' signs, on thecommand line resp. a map file; both ttf2tfm and ttf2pk switch then to subfont mode.It is possible to use more than a single SFD file by separating themwith commata and no whitespace; for a given subfont, the first file isscanned for an entry, then the next file, and so on. Later entriesoverride entries found earlier (possibly only partially). For example,the first SFD file sets up range 0x10-0xA0, and the next one modifiesentries 0x12 and 0x25. As can be easily seen, this algorithm allowsfor adding and replacing, but not for removing entries.Subfont mode disables the options `-n', `-N', `-p', `-r', `-R', `-t',`-T', `-u', `-v', `-w', and `-V' for ttf2tfm; similarly, no `Encoding'and `Replacement' parameter resp. single replacement glyph names areallowed in a map file.ttf2tfm will create ALL subfont TFM files specified in the SFD files(provided the subfont contains glyphs) in one run.Example: The call ttf2tfm ntukai.ttf ntukai@Big5,Big5-supp@ will use `Big5.sfd' and `Big5-supp.sfd', producing the subfont files ntukai01.tfm, ntukai02.tfm etc. ttf2pk should be then called on the subfonts directly: ttf2pk ntukai01 600 ttf2pk ntukai02 600 ...Some notes on file searching============================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -