FONTDATABASE(5)

πŸ“¦ version 5.1.2, in epel 10, epel 9, fedora 43, fedora 44

πŸ’– FONTDATABASE πŸ’–

okay bestie, gather round, we're reading the FONTDATABASE(5) page β€” yeah it's a File Formats Manual situation, section 5 energy, and it's literally the whole lore of how t1lib finds its fonts. no cap.


✨ NAME ✨

FontDataBase β€” the database of fonts that t1lib can actually see πŸ‘€


🌸 DESCRIPTION 🌸

okay so first thing, real talk: this manual page was written for the Debian GNU/Linux distribution, and it got adapted from the docs that ship with the upstream t1lib distribution. so like, credit where credit is due πŸ’…

/etc/t1lib/FontDataBase is a text file that contains β€” minimally β€” the basenames of Type 1 font files that should be made accessible to the t1lib font rasterizer library. and the format? intentionally similar to the fonts.dir and fonts.scale files that X11 uses. iykyk πŸ¦‹

Line 1 of this file is a positive integer that says how many fonts are declared in that file. same vibe as the fonts.dir files in the X11 system, fr fr.

All the remaining lines each declare one font. and here's the tea: the only thing anybody takes from such a line is the last string in it β€” the one delimited by white space. that string is assumed to be a filename shaped like basename.someextension.

The basename part is assumed to be the basename(1) of a fontfile. once that string has been parsed, the extension gets cut off and replaced, in turn, with .pfa and .pfb. then the initialization routine tries to open a font file in its search path using one of those resulting filenames. slay 🌈

And the rest of the line β€” like, everything from the beginning of the line up to where the filename string starts β€” is completely ignored, so it can totally hold info for other programs. main character line? no. supporting cast? yes. 🫢


πŸŽ€ EXAMPLES πŸŽ€

okay here's a minimal font database file for 4 fonts, cute and tiny:

4
isvl.afm
isvli.afm
isvd.afm
isvdi.afm

this file is minimal because it contains just the info that's needed and literally nothing the library doesn't need. no clutter, we love a clean girl aesthetic ✨


and here's a more realistic example πŸ“ β€” this one lets an application match a fully qualified X11 fontname to a FontID in t1lib. and yes, it's also a valid font database file:

4
Souvenir Souvenir-Light       --- -itc-souvenir-light-r-normal--#-0-0-0-p-0-iso8859-1 isvl.afm
Souvenir Souvenir-LightItalic -*- -itc-souvenir-light-i-normal--#-0-0-0-p-0-iso8859-1 isvli.afm
          Souvenir-Demi       *-- -itc-souvenir-demi-r-normal--#-0-0-0-p-0-iso8859-1 isvd.afm
          Souvenir-DemiItalic **- -itc-souvenir-demi-i-normal--#-0-0-0-p-0-iso8859-1 isvdi.afm

look at all that ignored-by-t1lib info just sitting there being useful for other programs. iconic behavior honestly πŸ‘‘


πŸ’œ FILES πŸ’œ

  • /etc/t1lib/FontDataBase

πŸ¦‹ SEE ALSO πŸ¦‹

  • mkfontdir(1x)

and that's the whole page bestie, FONTDATABASE(5), straight out of the t1lib File Formats Manual πŸ’– go forth and declare your fonts, periodt. πŸŒΈπŸ«ΆπŸ’…

πŸ“¦ where this page comes from