{
    "mode": "man",
    "parameter": "mkfontdir",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/mkfontdir/1/json",
    "generated": "2026-10-09T10:54:45Z",
    "synopsis": "mkfontdir  [-n]  [-x  suffix] [-r] [-p prefix] [-e encoding-directory-name] ...  [--] [direc‐\ntory-name ... ]",
    "sections": {
        "NAME": {
            "content": "mkfontdir - create an index of X font files in a directory\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "mkfontdir  [-n]  [-x  suffix] [-r] [-p prefix] [-e encoding-directory-name] ...  [--] [direc‐\ntory-name ... ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "For each directory argument, mkfontdir reads all of the font files in the directory searching\nfor properties named \"FONT\", or (failing that) the name of the file stripped of  its  suffix.\nThese  are  converted  to  lower case and used as font names, and, along with the name of the\nfont file, are written out to the file \"fonts.dir\" in the directory.  The X server  and  font\nserver use \"fonts.dir\" to find font files.\n\nThe  kinds  of font files read by mkfontdir depend on configuration parameters, but typically\ninclude PCF (suffix \".pcf\"), SNF (suffix \".snf\") and BDF (suffix \".bdf\").  If a  font  exists\nin multiple formats, mkfontdir will first choose PCF, then SNF and finally BDF.\n\nThe  first line of fonts.dir gives the number of fonts in the file.  The remaining lines list\nthe fonts themselves, one per line, in two fields.  First is the name of the font file,  fol‐\nlowed by a space and the name of the font.\n",
            "subsections": []
        },
        "SCALABLE FONTS": {
            "content": "Because  scalable  font  files do not usually include the X font name, the file \"fonts.scale\"\ncan be used to name the scalable fonts in the directory.  The fonts listed in it  are  copied\nto  fonts.dir  by  mkfontdir.  \"fonts.scale\" has the same format as the \"fonts.dir\" file, and\ncan be created with the mkfontscale(1) program.\n",
            "subsections": []
        },
        "FONT NAME ALIASES": {
            "content": "The file \"fonts.alias\", which can be put in any directory of the font-path, is  used  to  map\nnew  names  to  existing  fonts, and should be edited by hand.  The format is two white-space\nseparated columns, the first containing aliases and the second containing font-name patterns.\nLines beginning with \"!\" are comment lines and are ignored.\n\nIf neither the alias nor the value specifies the size fields of the  font  name,  this  is  a\nscalable  alias.   A font name of any size that matches this alias will be mapped to the same\nsize of the font that the alias resolves to.\n\nWhen a font alias is used, the name it references is searched for in the normal manner, look‐\ning through each font directory in turn.  This means that the aliases need not mention  fonts\nin the same directory as the alias file.\n\nTo  embed  white space in either name, simply enclose it in double-quote marks; to embed dou‐\nble-quote marks (or any other character), precede them with back-slash:\n\n\"magic-alias with spaces\"     \"\\\"font name\\\" with quotes\"\nregular-alias            fixed\n\nIf the string \"FILENAMESALIASES\" stands alone on a line, each file-name  in  the  directory\n(stripped of its suffix) will be used as an alias for that font.\n",
            "subsections": []
        },
        "ENCODING FILES": {
            "content": "The  option  -e can be used to specify a directory with encoding files.  Every such directory\nis scanned for encoding files, the list of which is then written to an  \"encodings.dir\"  file\nin every font directory.  The \"encodings.dir\" file is used by the server to find encoding in‐\nformation.\n\nThe \"encodings.dir\" file has the same format as \"fonts.dir\".  It maps encoding names (strings\nof the form CHARSETREGISTRY-CHARSETENCODING ) to encoding file names.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The following options are supported:\n",
            "subsections": [
                {
                    "name": "-e      -e",
                    "content": "ple times, and all the specified directories will be read.  The order of  the  entries\nis  significant,  as  encodings  found  in earlier directories override those in later\nones; encoding files in the same directory are discriminated by preferring  compressed\nversions.\n",
                    "flag": "-e"
                },
                {
                    "name": "-n",
                    "content": "generating encoding directories only.\n",
                    "flag": "-n"
                },
                {
                    "name": "-p",
                    "content": "ten to the \"encodings.dir\" file.  The prefix is prepended as-is.  If a `/' is required\nbetween the prefix and the path names, it must be supplied explicitly as part  of  the\nprefix.\n",
                    "flag": "-p"
                },
                {
                    "name": "-r",
                    "content": "ings.dir\"  file.   The default is to convert relative encoding directories to absolute\ndirectories by prepending the current directory.  The positioning of this  options  is\nsignificant, as this option only applies to subsequent -e options.\n",
                    "flag": "-r"
                },
                {
                    "name": "-x _",
                    "content": "Ignore fonts files of type suffix.\n\n--     End options.\n",
                    "flag": "-x"
                }
            ]
        },
        "FILES": {
            "content": "fonts.dir      List  of  fonts in the directory and the files they are stored in.  Created by\nmkfontdir.  Read by the X server and font server each time the  font  path  is\nset (see xset(1)).\n\nfonts.scale    List  of scalable fonts in the directory.  Contents are copied to fonts.dir by\nmkfontdir.   Can be created with mkfontscale(1).\n\nfonts.alias    List of font name aliases.  Read by the X server and font server each time the\nfont path is set (see xset(1)).\n\nencodings.dir  List of known encodings and the files they are stored in.  Created by  mkfont‐\ndir.   Read  by  the X server and font server each time a font with an unknown\ncharset is opened.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "X(7), Xserver(1), mkfontscale(1), xfs(1), xset(1)\n\nX Version 11                               mkfontdir 1.0.7                              MKFONTDIR(1)",
            "subsections": []
        }
    },
    "summary": "mkfontdir - create an index of X font files in a directory",
    "flags": [
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "ple times, and all the specified directories will be read. The order of the entries is significant, as encodings found in earlier directories override those in later ones; encoding files in the same directory are discriminated by preferring compressed versions."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "generating encoding directories only."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "ten to the \"encodings.dir\" file. The prefix is prepended as-is. If a `/' is required between the prefix and the path names, it must be supplied explicitly as part of the prefix."
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": "ings.dir\" file. The default is to convert relative encoding directories to absolute directories by prepending the current directory. The positioning of this options is significant, as this option only applies to subsequent -e options."
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": "Ignore fonts files of type suffix. -- End options."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "X",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/X/7/json"
        },
        {
            "name": "Xserver",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/Xserver/1/json"
        },
        {
            "name": "mkfontscale",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/mkfontscale/1/json"
        },
        {
            "name": "xfs",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xfs/1/json"
        },
        {
            "name": "xset",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xset/1/json"
        }
    ]
}