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/directory instead 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 using stty(1) to figure out its width. if that doesn't work either, it assumes 80 πŸ™ˆ

🚨 DIAGNOSTICS 🚨

❌ Errors

  • usage error: one or more font directories must be provided β€” you ran update-fonts-dir with no operands 😭 give it one or more X font directory names to work on
  • usage error: unrecognized option β€” you passed an option it doesn't know πŸ’€ only use the options listed in "OPTIONS" above
  • fatal 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, so update-fonts-dir skipped it πŸ™ˆ

🏁 EXIT STATUS 🏁

  • 0 β€” update-fonts-dir ran successfully ✨
  • 1 β€” update-fonts-dir hit a fatal error. check the diagnostic messages section above πŸ’€
  • 2 β€” update-fonts-dir was 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