You will query an X server for fonts that match a pattern, then choose between a compact list and progressively more detailed inspection. The examples use the installed xlsfonts 1.0.7 from Debian's x11-utils 7.7+6build2 package.
Allow about ten minutes for a first check. You need an X server that accepts your connection and a shell with the correct DISPLAY value. The commands query the server and do not change its font configuration.
Start by confirming which program will run and whether the shell has a display target:
$ command -v xlsfonts
/usr/bin/xlsfonts
$ printf 'DISPLAY=%s\n' "${DISPLAY-}"
DISPLAY=:0
Your display may be something like :1 or host.example:0. If DISPLAY is empty, the default query cannot work. Set it only to a display you are authorised to use:
$ export DISPLAY=:0
Do not reach for sudo to solve a display error. X access control belongs to the display session, and running the client as another user can make authentication fail or expose more of the session than intended.
Checkpoint: command -v shows the expected executable and DISPLAY names the intended X server.
With no pattern, xlsfonts behaves as if you supplied *. Quote the wildcard so the shell passes it to xlsfonts instead of expanding local filenames:
$ xlsfonts '*'
Each line is an X Logical Font Description, or XLFD, such as:
-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1
The exact list depends on the fonts installed in, and made available by, this X server. A successful command may print many lines. A command that reports unable to open display has not queried the server; fix the connection first.
Use a narrower pattern when you know part of the name. The ? wildcard matches one character and * matches any sequence, including an empty sequence:
$ xlsfonts '*fixed*'
$ xlsfonts -fn '-misc-fixed-*'
Both wildcard characters must be quoted. Treat a pattern as a filter, not as a promise that a font exists: an empty result is a valid result for a connected server.
Use the explicit -fn option when a pattern starts with a hyphen, as XLFD names normally do. Without it, the command can interpret the pattern as another command-line option.
The default layout tries to fit as many names as possible into a width of 79 characters. Force one name per line when you want stable output for a human or a script:
$ xlsfonts -1 '*fixed*'
-1 is the same as -n 1. For a compact display, set a wider output width or ask for a fixed number of columns:
$ xlsfonts -w 120 '*fixed*'
$ xlsfonts -n 3 '*fixed*'
$ xlsfonts -C '*fixed*'
-C is the same as -n 0 and requests multiple columns. These options change presentation only. They do not change which fonts the server returns.
Use -u when the server's returned order matters to your investigation:
$ xlsfonts -u -1 '*fixed*'
Without -u, the normal listing is sorted. Do not build a test that depends on the order unless you deliberately request unsorted output and have a reason for doing so.
Names tell you what matched, but not the font properties or bounds. Add one level of detail at a time:
$ xlsfonts -l -1 -fn '-misc-fixed-*'
$ xlsfonts -ll -1 -fn '-misc-fixed-*'
$ xlsfonts -lll -1 -fn '-misc-fixed-*'
-l adds attributes on the same line as each name. -ll adds font properties, and -lll adds character metrics as well. The output becomes much larger, so start with a narrow pattern and one or two matches.
Add -m to a long listing when you need the minimum and maximum bounds:
$ xlsfonts -l -m -1 -fn '-misc-fixed-*'
Safety boundary: The installed manual warns that -l can tie up a single-threaded, non-pre-emptive X server for a long time. Do not begin a broad xlsfonts -l '*' query on a busy or fragile display. Stop it with Ctrl-C if the session becomes unresponsive, then retry with a specific pattern. This interrupts the query and does not alter font files.
Most queries use the X server's font-listing request. The -o option instead asks xlsfonts to open the font and query it, which can help with some scaled font systems where listing fails to show a known font:
$ xlsfonts -o -l -1 -fn '-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1'
This is a diagnostic alternative, not a way to install or enable a font. It still needs a working display connection and a font name that the server can open. Compare the result with the ordinary listing request:
$ xlsfonts -1 -fn '-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1'
$ xlsfonts -o -1 -fn '-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1'
If both commands fail, check the exact XLFD spelling and the X server's font configuration. Do not infer availability from a font file sitting on disk: xlsfonts reports what the server can provide.
Use -display, or its short form -d, when the query should not use DISPLAY:
$ xlsfonts -display host.example:0 -1 '*fixed*'
$ xlsfonts -d host.example:0 -1 '*fixed*'
Only query a remote display when its owner has authorised your connection and the network path is protected by the environment's normal X security controls. A display name is not a password. If you see an authentication or connection error, stop and fix access at the session or transport layer rather than trying random privileged users.
Use this short decision path:
DISPLAY, the X server state and the session's authorisation.'*'. An empty narrow match is not necessarily an error.-1, and avoid long listings until the match set is small.-o; check the server rather than only the local filesystem.-u only when unsorted server order is useful. Otherwise consume names as a set.Print the program version when you are recording a reproducible diagnostic:
$ xlsfonts -v
On this installation, the manpage identifies the program as version 1.0.7. Version output and diagnostics are not font-list results, so do not use them as evidence that the display connection works.
xlsfonts and a permitted DISPLAY.-l, -ll, -lll and -m add useful detail, and when a broad long query could stall a server.-o for a known font without changing server configuration.