A font looking subtly wrong in an X application is a classic time sink. xfd settles it fast by showing exactly what glyphs a font contains.
Allow about ten minutes. You need an X display, the x11-utils package, and at least one installed font. This guide describes the installed Debian/Ubuntu build here: x11-utils 7.7+6build2, whose manual page identifies the utility as xfd 1.1.4. The window cannot be tested from a shell with no usable DISPLAY, so check that first.
Run these as your normal user; there is no reason to reach for sudo to inspect a font.
$ command -v xfd
/usr/bin/xfd
$ printf 'DISPLAY=%s\n' "${DISPLAY-}"
DISPLAY=:0
$ fc-list : family style | head
The exact font list depends on the machine. A blank DISPLAY means this shell is not connected to an X display.
Security boundary: set DISPLAY only when you have been given a real display and matching X authentication, for example by running the command from the graphical session. Do not guess a display number or copy another user's MIT-MAGIC-COOKIE.
Checkpoint: continue only once command -v finds xfd and a normal X client can connect from the same shell.
For modern fontconfig and FreeType fonts, use -fa. Its argument is an Xft font pattern, not a path to a font file. Ask fontconfig how it resolves one first:
$ fc-match 'DejaVu Sans:size=18'
DejaVuSans.ttf: "DejaVu Sans" "Book"
Your result may name a different file or family. Swap in a pattern that fc-match resolves on your host, then start xfd:
$ xfd -fa 'DejaVu Sans:size=18'
A successful launch leaves the terminal attached while the window stays open. It shows the resolved full font name, a grid of glyphs, and buttons labelled Prev, Next and Quit. Click a glyph to see its index, width, bearings, ascent and descent; the first cell normally starts at character number 0.
Can't open display means fix the X session or authentication first, before you touch the font pattern. A font that will not open means try fc-match with a simpler installed family name.
Core X fonts are selected with -fn and use X server-side font names, commonly XLFD names. Ask the server for candidates with xlsfonts, part of the same general X toolset:
$ xlsfonts | head
-adobe-helvetica-medium-r-normal--17-120-100-100-p-88-iso8859-1
-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1
Use one exact name your server returned. A font listed by fc-list is not automatically available as a core X font too:
$ xfd -fn '-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1'
The shell quotes the XLFD so its punctuation passes through as one argument. No useful names from xlsfonts usually means the server does not provide the legacy core-font catalogue you were expecting; use the -fa route instead.
A few display options are worth knowing:
-center centres each glyph in its cell. Add it when a glyph has a negative left bearing or an unusually large ascent, descent or right bearing, which is common with cursor-like fonts where a glyph lands outside the cell you expected.-box draws the ImageText fill rectangle. It is purely diagnostic: it does not change the glyph or the font.-rows and -columns control the grid layout, not font size. Use them to change how many cells fit on screen.$ xfd -fa 'DejaVu Sans:size=18' -center
$ xfd -fa 'DejaVu Sans:size=18' -box -center
Use -start to choose the glyph index shown in the upper-left cell, useful when the first page is mostly empty or you're investigating a specific range:
$ xfd -fa 'DejaVu Sans:size=18' -start 65
The value is an index the font understands, not a promise that a matching Unicode character exists. Click the cells and read the displayed range and metrics to see what the server actually supplied. Start beyond the font's useful range and you get empty or non-existent characters, not an error that tells you the right value.
Click Quit when you are finished. xfd only displays the selected font and makes no persistent font, X server or desktop configuration changes. Stuck in the foreground? Focus the terminal and press Ctrl-C; that ends the client without touching the font.
There is no elevated-privilege recovery step here, because nothing needs recovering. Keep the exact command and pattern that worked if you need to reproduce the inspection. For a failed run, note whether the problem was the display, the font source (-fn or -fa) or the requested range, and change one variable at a time.
xfd is installed and the shell can connect to the intended X display.fc-match resolves the Xft pattern, or xlsfonts supplies an exact core-font name.