FONTSRV(4)

πŸ“¦ version 0_git20260208, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable

πŸ’… FONTSRV(4) β€” host fonts, but make it file-system cute πŸ’…

okay so bestie, this is the FONTSRV(4) page from the Kernel Interfaces Manual, and it’s literally about fontsrv: file system access to host fonts. No cap, it’s giving β€œyour host window system’s fonts, but served in the standard Plan 9 format” energy, and we’re gonna go through every tiny detail. 🫢

πŸ’– NAME πŸ’–

fontsrv - file system access to host fonts πŸ’–

🌸 SYNOPSIS 🌸

fontsrv [ -m mtpt ] [ -s srvname ]

fontsrv -p path

πŸ¦‹ DESCRIPTION πŸ¦‹

Fontsrv presents the host window system’s fonts in the standard Plan 9 format β€” yes, see font(7), bestie. It serves a virtual directory tree mounted at mtpt (only if you give the -m option) and posted at srvname (default: font). Slay.

The -p option changes fontsrv’s behavior: instead of serving a file system, fontsrv prints to standard output the contents of the named path. If path names a directory in the served file system, fontsrv lists the directory’s contents. Cute, right? πŸŽ€

πŸ’… the option vibe check πŸ’…

  • -m mtpt β€” serves the virtual directory tree mounted at mtpt when this option is given.
  • -s srvname β€” posts the tree at srvname; the default is font.
  • -p path β€” changes fontsrv’s behavior: instead of serving a file system, it prints to standard output the contents of the named path; if path names a directory in the served file system, it lists the directory’s contents.

The fonts are arranged in a two-level tree. The root contains directories named for each system font. Each font directory contains subdirectories named for a point size and whether the subfonts are anti-aliased: 10 (bitmap) 10a (anti-aliased greyscale) 12, 12a, and so on. The font directory will synthesize additional sizes on demand: looking up 19a will synthesize the 19-point anti-aliased size if possible. Each size directory contains a font file and subfont files named x0000.bit, x0020.bit, and so on representing 32-character Unicode ranges. Obsessed with the structure tbh. πŸ¦‹

Openfont (see graphics(3)) recognizes font paths beginning with /mnt/font and implements them by invoking fontsrv; it need not be running already. See font(7) for a full discussion of font name syntaxes. iykyk. πŸ‘‘

🌈 EXAMPLES 🌈

List the fonts on the system:

% fontsrv &
% 9p ls font

or:

% fontsrv -p .

Run acme(1) using the operating system’s Monaco as the fixed-width font:

% acme -F /mnt/font/Monaco/13a/font

Run sam(1) using the same font:

% font=/mnt/font/Monaco/13a/font sam

πŸ’œ SOURCE πŸ’œ

/src/cmd/fontsrv

πŸ‘‘ SEE ALSO πŸ‘‘

font(7)

πŸ’€ BUGS πŸ’€

  • Due to OS X restrictions, fontsrv does not fork itself into the background when serving a user-level file system. Not me being dramatic, it’s just facts. 😭
  • Fontsrv has no support for X11 fonts; on X11 systems, it will serve an empty top-level directory.
  • On OS X, the anti-aliased bitmaps are not perfect. For example, the lower case r in the subfont Times-Roman/14a/x0000.bit appears truncated on the right and too light overall. πŸ’€

And that’s a wrap on FONTSRV(4) from the Kernel Interfaces Manual, bestie β€” the source is /src/cmd/fontsrv, and the footer just signs off as FONTSRV(4) with no extra date listed πŸŽ€βœ¨πŸ’–