{
    "mode": "man",
    "parameter": "afm2pl",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/afm2pl/1/json",
    "generated": "2026-05-30T05:14:48Z",
    "synopsis": "afm2pl [-p encodingfile] [-o] [-e extensionfactor] [-s slantfactor] [-f fontdimensions]\n[-k] [-m letterspacing] [-l ligkernspec] [-L ligkernspec] [-n] inputfile[.afm]\n[outputfile[.pl]]\nafm2pl [--help] | [--version]",
    "sections": {
        "NAME": {
            "content": "afm2pl - convert AFM font metrics to TeX pl font metrics\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "afm2pl [-p encodingfile] [-o] [-e extensionfactor] [-s slantfactor] [-f fontdimensions]\n[-k] [-m letterspacing] [-l ligkernspec] [-L ligkernspec] [-n] inputfile[.afm]\n[outputfile[.pl]]\n\nafm2pl [--help] | [--version]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "afm2pl converts an afm (Adobe Font Metric) file into a pl (Property List) file, which in its\nturn can be converted to a tfm (TeX Font Metric) file. It normally preserves kerns and\nligatures, but also offers additional control over them.\n\nafm2pl is meant to be a partial replacement for afm2tfm, on which it is based. With afm2tfm,\npreserving kerns and ligatures is possible only in a roundabout way, and handling of them is\nhard-wired.\n\nFor text fonts, Y&Y´s texnansi is a good encoding to be used with afm2pl. Its character set\nincludes all the accented characters likely to be needed for Western languages, plus many\ntypographic symbols, without a need for either virtual fonts or a separate text companion\nfont.\n\nFull LaTeX support for this encoding is available in the form of the texnansi package, which\nis already part of TeX Live and teTeX. These distributions also contain the encoding file\ntexnansi.enc.\n\nThe distribution contains uppercased and lowercased versions of texnansi, viz. texnanuc and\ntexnanlc, to allow font-based rather than macro-based uppercasing and lowercasing, and the\nfamiliar old ot1 encoding plus some variations in PostScript .enc format (I included these\nbecause they seem to be absent from teTeX/TeX Live). However, check your mapfiles if you have\nold afm2pl-generated fonts using these.\n\nReturn value: 0 if no error; a negative number indicating the number of missing glyphs if\nconversion was otherwise successfull but glyphs are missing, and 1 in case of error.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-p",
                    "content": "The default is the encoding specified in the afm file, which had better match the\nencoding in the fontfile (pfa or pfb). If afm2pl-name.enc exists, afm2pl will use this\nfile instead of name.enc, unless an option -n is given. The generated mapfile entry (see\nbelow) instructs pdftex or the dvi driver to reencode the font on the fly. On-the-fly\nreencoding does not require virtual fonts.\n",
                    "flag": "-p"
                },
                {
                    "name": "-o",
                    "content": "Use octal for all character codes in the pl file.\n",
                    "flag": "-o"
                },
                {
                    "name": "-e",
                    "content": "Widen or narrow characters by extendfactor. Default is 1.0 (natural width). Not\nrecommended[1].\n",
                    "flag": "-e"
                },
                {
                    "name": "-s",
                    "content": "Oblique (slant) characters by slantfactor. Not recommended either.\n",
                    "flag": "-s"
                },
                {
                    "name": "-f",
                    "content": "The value is either the keyword afm2tfm or a comma-separated list of up to five integers.\nThe parameters are listed below, with their defaults and their value when the afm2tfm\nkeyword is specified. ‘Space’ means the width of a space in the target font, except of\ncourse in the last row. Keep in mind that the design size is 1000, and that all numbers\nmust be nonnegative integers.\n\n┌───────────────┬───────────────────────┬───────────────────────┐\n│Font dimension │ Default value         │ Afm2tfm value         │\n├───────────────┼───────────────────────┼───────────────────────┤\n│stretch        │ space div 2           │ 300 × extendfactor   │\n├───────────────┼───────────────────────┼───────────────────────┤\n│shrink         │ space div 3           │ 100 × extendfactor   │\n├───────────────┼───────────────────────┼───────────────────────┤\n│extra space    │ space div 3           │ missing               │\n├───────────────┼───────────────────────┼───────────────────────┤\n│quad           │ 2 × width of ‘0’      │ 1000 × extendfactor  │\n├───────────────┼───────────────────────┼───────────────────────┤\n│space          │ (space source font) × │ (space source font) × │\n│               │ extendfactor         │ extendfactor         │\n└───────────────┴───────────────────────┴───────────────────────┘\nFor fixed-pitch fonts, different values apply:\n\n┌───────────────┬─────────────────────┬──────────────────────┐\n│Font dimension │ Default value       │ Afm2tfm value        │\n├───────────────┼─────────────────────┼──────────────────────┤\n│stretch        │ 0                   │ 0                    │\n├───────────────┼─────────────────────┼──────────────────────┤\n│shrink         │ 0                   │ 0                    │\n├───────────────┼─────────────────────┼──────────────────────┤\n│extra space    │ space               │ missing              │\n├───────────────┼─────────────────────┼──────────────────────┤\n│quad           │ 2 × character width │ 1000 × extendfactor │\n├───────────────┼─────────────────────┼──────────────────────┤\n│space          │ character width     │ character width      │\n└───────────────┴─────────────────────┴──────────────────────┘\nSpecify just a non-default stretch and shrink with e.g.  150,70 and just a non-default\nextra space with ,,10.\n",
                    "flag": "-f"
                },
                {
                    "name": "-k",
                    "content": "Keep original ligatures. This option only has effect in combination with positive\nletterspacing; see the section on letterspacing and extra ligkern info.\n",
                    "flag": "-k"
                },
                {
                    "name": "-m",
                    "content": "Letterspace by letterspacing/1000 em (integer). This is useful for making all-caps\ntypesetting look better. Try a value of e.g. 50 or 100. But see the section on\nletterspacing and extra ligkern info for details. A better alternative, though, is\nletting pdftex do the letterspacing. The microtype package gives LaTeX users access to\nthis feature.\n",
                    "flag": "-m"
                },
                {
                    "name": "-l -L",
                    "content": "See the section on extra ligkern info for details.\n",
                    "flag": "-L"
                },
                {
                    "name": "-n",
                    "content": "No prefix. For .enc- and .lig files, the program normally first prefixes the name with\n`afm2pl-´. Only if the prefixed filename is not found, will it search for the original\nfilename. This option prevents searching for the prefixed filename.\n",
                    "flag": "-n"
                },
                {
                    "name": "-V",
                    "content": "Verbose. If turned on, it reports the number of missing glyphs to stderr and their names\nto stdout.\n",
                    "flag": "-V"
                },
                {
                    "name": "--help",
                    "content": "Display a short usage message.\n",
                    "long": "--help"
                },
                {
                    "name": "--version",
                    "content": "Display the version number of afm2pl.\n",
                    "long": "--version"
                }
            ]
        },
        "MAPFILE ENTRIES": {
            "content": "afm2pl writes a mapfile entry to a file with the same basename as the pl output file, but\nwith extension .map. It can be used for the dvips mapfile and for the pdftex mapfile. It is\nassumed that the pfb file has the same basename as the afm file and must be downloaded.  You\nmay have to hand-edit this entry.\n\nYou can configure dvips and pdftex to read this additional mapfile or otherwise add the entry\nto an existing mapfile.\n\nCheck your mapfiles!  To reduce the likelihood of name conflicts, the .enc- files which are\npart of afm2pl (ot1, ot1csc, ot1ital, ot1tt, texnanlc and texnanuc) have now been prepended\nwith afm2pl-. The .enc files are referenced in mapfiles. If you have old afm2pl-generated\n.tfm files using these, then you should update their mapfile fragments and rerun updmap or\nupdmap-sys. Or you can copy the relevant enc files to your personal or local texmf tree under\ntheir previous non-prefixed names.\n",
            "subsections": []
        },
        "EXTRA LIGKERN INFO": {
            "content": "Most users are well-advised to leave this mess alone and to accept the default behavior.\n\nThe ligatures and kerns present in the afm file can be modified in various ways. Default, the\nencoding file is scanned for extra ligkern specifications, whose format will be described\nbelow. If there are no ligkern specifications in the encoding file, then extra ligkern\nspecifications will be read from a file [afm2pl-]default.lig. A value of 0 for ligkernspec\nmeans that the ligatures and kerns from the afm file won´t be tampered with and a value of 1\nspecifies default behavior. One can also specify a comma-separated list of files with extra\nligkerns specs.\n\nIf afm2pl is compiled with the kpathsea library, then these files will be searched for under\n$TEXMF/fonts/lig.\n\nNote that ligatures and kerns are hints for the typesetting application; there is no need to\ndownload this information to the printer or to make it available to a dvi driver.\n\nThe parser for ligkern info has been inherited from afm2tfm virtually without change. A\nligkern specification can have one of the following forms:\n\nglyphname1 glyphname2 ligop glyphname3 ;\n\nThis specifies a ligature. Possible values for ligop are =:, |=:, |=:>, =:|, =:|>, |=:|,\n|=:|> and |=:|>>. These correspond to LIG, /LIG, /LIG>, LIG/, LIG/>, /LIG/, /LIG/>, /LIG/>>\nin .pl syntax; see the pltotf documentation and the .lig files in the distribution.\n\nglyphname1 <> glyphname2 ;\n\nKern glyphname1 as glyphname2.\n\nglyphname1 {} glyphname2 ;\n\nRemove the kern between glyphname1 and glyphname2. A value of * for either glyph name is\ninterpreted as a wildcard.\n\n|| = glyph ;\n\nSet the (right) boundary character to glyph.  glyph may be either a glyphname or a slot in\nthe encoding vector. Choosing a glyph which doesn´t occur in the output encoding is\nequivalent to not specifying a boundarychar at all. It is ok to pick an encoded glyphname\nwhich does not occur in the afm. In fact, this is what default.lig does: || = cwm ;.\n\nYou can copy the kerns of an unencoded character to the boundarychar. Below, space is the\nunencoded character:\n\n|| <> space ;\n\nThis ligkern specification should occur before the one that deletes space kerns.\n\nA ligkern specification should be contained within one line. One line may contain several\nligkern specifications, separated by spaces. Note that ; (space followed by semicolon) is\nconsidered part of the ligkern specification. See the lig files included in this\ndistribution. Example:\n\none {} * ; * {} one ; two {} * ; * {} two ;\n\nLines with ligkern specifications inside an encoding file should start with % LIGKERN.\nLigkern specifications in a lig file may optionally start this way.\n",
            "subsections": []
        },
        "LETTERSPACING AND EXTRA LIGKERN INFO": {
            "content": "Letterspacing has various side-effects for ligkern info. Instead of simply applying the extra\nligkern info (see previous section), the following is done:\n\n\n1.     In case of positive letterspacing, native ligatures are removed, unless the -k option\nis specified.\n\n\n2.     Extra ligkern info is applied as usual, except that in case of positive letterspacing\ndifferent defaults apply: -l 0 is quietly ignored, ligkern comments in the encoding\nfile are ignored, and defpre.lig is read instead of default.lig.\n\n\n3.     Letterspacing is applied. This adds a lot of kerns, and modifies existing kerns.\n\n\n4.     The extra ligkern info specified with -L is applied. The only ligkern specs which are\nallowed here, are removals of kerning pairs (with the {} operator). Values 0 and 1\nhave a similar meaning as for the -l parameter.  The tfm format has room for only\nabout 180x180 ligatures and kerning pairs.  This is enough for OT1 encoding, but for\ntexnansi encoding quite a few ligkern specifications have to be removed. The pltotf\nprogram will remove all ligkern info if too many ligatures and kerns remain. The\ndefault lig file is defpost.lig. This file throws out kerning pairs which are unlikely\nto be involved in letterspacing, such as kerns involving accents or kerns with a\npunctuation character or right bracket at the left. It does not add letterspacing\nkerns involving boundarychars. Instead, fontspace is increased by twice the\nletterspacing. defpost.lig throws out enough kerns in case of texnansi encoding. With\nother encodings, you may have to throw out additional kerning pairs.\n\n",
            "subsections": []
        },
        "FONT-BASED UPPER- AND LOWERCASING": {
            "content": "The distribution includes encoding vectors texnanuc.enc and texnanlc.enc which produce\nall-uppercase and all-lowercase fonts\n\nThe principal uses for an all-uppercase font are page headers and section heads. If these\ncontain math, then macro-based uppercasing would create unpleasant complications. Example:\n\nafm2pl -p texnanuc ptmr8a ptmup8y\npltotf ptmup8y\n\nFor best results, you should add some letterspacing. In LaTeX, this is best done with the\nmicrotype package; see the documentation of that package. But it can also be done with\nafm2pl:\n\nafm2pl -p texnanuc -m 100 ptmr8a ptmup8y\n\nThis requires caution; see above.\n\nYou can use this new font within the context of LaTeX font selection as follows:\n\n\n<preamble commands>\n\\makeatletter\n{\\nfss@catcodes\n\\DeclareFontShape{LY1}{ptm}{m}{upp}{<-> ptmup8y}{}}\n\\makeatother\n...\n\\begin{document}\n...\n{\\fontshape{upp}\\selectfont uppercase text}\n\n\nNote that upp is simply a newly made-up shape name.\n\nThe sz ligature ßß\nNote that the texnanuc encoding provides no glyph for the sz ligature ß; you´ll either have\nto substitute ss or provide a macro-based solution. The following code uses either the usual\nglyph or substitutes the letters ss, depending on whether the glyph exists in the current\nfont:\n\n\n\\def\\ss{%\n\\setbox0\\hbox{\\char25}%\n\\ifnum\\wd0=0 ss\\else\\box0\\fi\n}\n\n\nIn LaTeX, this code appears to work well enough, although on occasion you may need to insert\n\\protect. A better solution might involve the sixth parameter of the \\DeclareFontShape macro,\nbut I failed to get that to work.\n",
            "subsections": [
                {
                    "name": "AFM2PL, FONTINST AND ARTIFICIAL SMALLCAPS",
                    "content": "Afm2pl doesn´t do virtual fonts. That means that for things such as artificial smallcaps you\nhave to turn elsewhere, e.g. to the fontinst package, which is part of any mainstream TeX\ndistribution.\n\nLook under texmf/tex/fontinst for fontinst support files, which allow you to generate a\nsmallcaps font (tfm and vf files) from an afm2pl-generated tfm file. This package only\nsupports texnansi encoding.\n\nThere should be no real problem in doing the same for OT1 encoding. However, there are\nseveral variations of the OT1 encoding to take care of. Also, there are as far as I know no\nofficially sanctioned PostScript names for all the variations of the OT1 encoding; the\nfontinst names contain spaces and are therefore not useable as PostScript names.\n"
                },
                {
                    "name": "CHANGED IN VERSION 0.7.1",
                    "content": "In order to avoid name conflicts, the .enc- and .lig files distributed with afm2pl got\nafm2pl- prepended to their name. The program itself now first searches for the thus prepended\nname. If the .enc- or .lig file is not found it will look for the original filename. The\nrenaming of the afm2pl .enc files may require modification of some mapfiles.\n"
                }
            ]
        },
        "URLS": {
            "content": "The afm2pl homepage is http://tex.aanhet.net/afm2pl/.\n\nThe paper Font installation the shallow way[2] (EuroTeX 2006 Proceedings, published as\nTUGboat[3] issue 27.1) illustrates the use of afm2pl.\n",
            "subsections": []
        },
        "NOTES": {
            "content": "1. Except that arguably a narrowed Courier is less jarring than a full-width Courier, when\nused in combination with a normal proportional font. For Courier, choose .833 to match\nthe width of cmtt. Better yet, don't use Courier at all; most TeX distributions offer\nvarious good replacements.\n\n2. Font installation the shallow way\nhttp://www.tug.org/TUGboat/Articles/tb27-1/tb86kroonenberg-fonts.pdf\n\n3. TUGboat\nhttp://www.tug.org/TUGboat/\n\n\n\nMay 2009                                     AFM2PL(1)",
            "subsections": []
        }
    },
    "summary": "afm2pl - convert AFM font metrics to TeX pl font metrics",
    "flags": [
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "The default is the encoding specified in the afm file, which had better match the encoding in the fontfile (pfa or pfb). If afm2pl-name.enc exists, afm2pl will use this file instead of name.enc, unless an option -n is given. The generated mapfile entry (see below) instructs pdftex or the dvi driver to reencode the font on the fly. On-the-fly reencoding does not require virtual fonts."
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "Use octal for all character codes in the pl file."
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "Widen or narrow characters by extendfactor. Default is 1.0 (natural width). Not recommended[1]."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "Oblique (slant) characters by slantfactor. Not recommended either."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "The value is either the keyword afm2tfm or a comma-separated list of up to five integers. The parameters are listed below, with their defaults and their value when the afm2tfm keyword is specified. ‘Space’ means the width of a space in the target font, except of course in the last row. Keep in mind that the design size is 1000, and that all numbers must be nonnegative integers. ┌───────────────┬───────────────────────┬───────────────────────┐ │Font dimension │ Default value │ Afm2tfm value │ ├───────────────┼───────────────────────┼───────────────────────┤ │stretch │ space div 2 │ 300 × extendfactor │ ├───────────────┼───────────────────────┼───────────────────────┤ │shrink │ space div 3 │ 100 × extendfactor │ ├───────────────┼───────────────────────┼───────────────────────┤ │extra space │ space div 3 │ missing │ ├───────────────┼───────────────────────┼───────────────────────┤ │quad │ 2 × width of ‘0’ │ 1000 × extendfactor │ ├───────────────┼───────────────────────┼───────────────────────┤ │space │ (space source font) × │ (space source font) × │ │ │ extendfactor │ extendfactor │ └───────────────┴───────────────────────┴───────────────────────┘ For fixed-pitch fonts, different values apply: ┌───────────────┬─────────────────────┬──────────────────────┐ │Font dimension │ Default value │ Afm2tfm value │ ├───────────────┼─────────────────────┼──────────────────────┤ │stretch │ 0 │ 0 │ ├───────────────┼─────────────────────┼──────────────────────┤ │shrink │ 0 │ 0 │ ├───────────────┼─────────────────────┼──────────────────────┤ │extra space │ space │ missing │ ├───────────────┼─────────────────────┼──────────────────────┤ │quad │ 2 × character width │ 1000 × extendfactor │ ├───────────────┼─────────────────────┼──────────────────────┤ │space │ character width │ character width │ └───────────────┴─────────────────────┴──────────────────────┘ Specify just a non-default stretch and shrink with e.g. 150,70 and just a non-default extra space with ,,10."
        },
        {
            "flag": "-k",
            "long": null,
            "arg": null,
            "description": "Keep original ligatures. This option only has effect in combination with positive letterspacing; see the section on letterspacing and extra ligkern info."
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "Letterspace by letterspacing/1000 em (integer). This is useful for making all-caps typesetting look better. Try a value of e.g. 50 or 100. But see the section on letterspacing and extra ligkern info for details. A better alternative, though, is letting pdftex do the letterspacing. The microtype package gives LaTeX users access to this feature."
        },
        {
            "flag": "-L",
            "long": null,
            "arg": null,
            "description": "See the section on extra ligkern info for details."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "No prefix. For .enc- and .lig files, the program normally first prefixes the name with `afm2pl-´. Only if the prefixed filename is not found, will it search for the original filename. This option prevents searching for the prefixed filename."
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": "Verbose. If turned on, it reports the number of missing glyphs to stderr and their names to stdout."
        },
        {
            "flag": "",
            "long": "--help",
            "arg": null,
            "description": "Display a short usage message."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Display the version number of afm2pl."
        }
    ],
    "examples": [],
    "see_also": []
}