update-fonts-dir(8)
π NAME π
okay bestie, this is update-fonts-dir(8) from the System Manager's Manual, and it is so iconic for keeping X font folders tidy β¨
update-fonts-dir - compile fonts.dir files π
π§ SYNOPSIS π§
update-fonts-dir [OPTION] directory ...
πΈ DESCRIPTION πΈ
okay so update-fonts-dir makes a fonts.dir file inside an X font directory by calling mkfontdir(1x) with the right arguments π
it's basically only run from the post-installation and post-removal scripts of a package that ships fonts for the X Window System, but you can totally run it whenever you want to rebuild fonts.dir files π«Ά for each directory (which is just the last part of its path, like 75dpi or misc), it generates either /usr/lib/X11/fonts/directory/fonts.dir or /usr/share/fonts/X11/directory/fonts.dir from the fonts.scale file and the font files sitting in there β¨
this is the glow-up part: multiple packages can give names to fonts in the same directory π¦ no font package actually ships the fonts.dir file in the X font directory itself, so nobody can accidentally overwrite another package's font names. no drama, no cap π
for example, say the two packages xfonts-base (real) and xfonts-nifty (hypothetical) both install fonts into /usr/lib/X11/fonts/misc. update-fonts-dir makes sure the fonts.dir file in that folder knows about the font files from both packages π₯Ή
the format of fonts.dir files is explained in the mkfontdir(1x) manual page π
there's also an example of how to use update-fonts-dir in package maintainer scripts in the Debian Policy Manual π
π OPTIONS π
-h,--helpβ shows a quick usage message and then bounces π-7,--x11r7-layoutβ switches to the layout introduced in X11R7, so fonts go in/usr/share/fonts/X11/directoryinstead of the default/usr/lib/X11/fonts/directoryπ
π«§ OPERANDS π«§
update-fonts-dir wants one or more X font directory names as operands π only the final path component should be used. so this is the correct way:
update-fonts-dir 75dpi
but update-fonts-dir /usr/X11R6/lib/X11/fonts/75dpi and update-fonts-dir /usr/lib/X11/fonts/75dpi are a no from me π
ββοΈ
π ENVIRONMENT π
COLUMNSβ this tells the program how wide the terminal is, in character cells, so diagnostic messages line up nicely π if it isn't set, the terminal gets asked usingstty(1)to figure out its width. if that doesn't work either, it assumes80π
π¨ DIAGNOSTICS π¨
β Errors
usage error: one or more font directories must be providedβ you ranupdate-fonts-dirwith no operands π give it one or more X font directory names to work onusage error: unrecognized optionβ you passed an option it doesn't know π only use the options listed in "OPTIONS" abovefatal error: path to X font directory must be usedβ you gave a directory name that isn't an X font directory name π₯ only supply X font directory names
β οΈ Warnings
warning: absolute path directory was provided β using absolute paths is deprecated, so please just use the final component of the X font directory name π«
warning: directory does not exist or is not a directoryβ that directory isn't valid, soupdate-fonts-dirskipped it π
π EXIT STATUS π
0βupdate-fonts-dirran successfully β¨1βupdate-fonts-dirhit a fatal error. check the diagnostic messages section above π2βupdate-fonts-dirwas called with invalid arguments π ββοΈ
π BUGS π
bugs are tracked in the Debian Bug Tracking System at https://bugs.debian.org/xfonts-utils π if you want to report a bug in update-fonts-dir, check /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command π
π©βπ» AUTHOR π©βπ»
update-fonts-dir was written by Branden Robinson. legend π
π SEE ALSO π
mkfontdir(1x)π
bestie, that's the whole page π«Ά Debian Project, 2004-11-11, update-fonts-dir(8) ππ¦
π¦ where this page comes from
- debian bookworm: xfonts-utils 1:7.7+6
- debian trixie: xfonts-utils 1:7.7+7
- ubuntu jammy: xfonts-utils 1:7.7+6build2
- ubuntu noble: xfonts-utils 1:7.7+6build3
- ubuntu questing: xfonts-utils 1:7.7+7
- ubuntu resolute: xfonts-utils 1:7.7+7build1
- ubuntu stonking: xfonts-utils 1:7.7+7build1
- Copyright 1999, 2002-2004 Branden Robinson <branden@debian.org>
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms