The xlsfonts
command is used to list the fonts used by the X server. It displays a list of all the fonts that are available to the X server, including the font family, font size, and font style.
Overview
The xlsfonts
command is used to list all the fonts that are available to the X server. The output of the command is a list of font names, each on a separate line. The font names are displayed in the following format:
-family-weight-slant-setwidth-addstyle-pixelsize-pointsize-resx-resy-spacing-avgwidth-registry-encoding
Here is an example of the output of the xlsfonts
command:
-adobe-helvetica-medium-r-normal--0-0-0-0-p-0-iso8859-1
-adobe-helvetica-medium-r-normal--10-100-75-75-p-56-iso8859-1
-adobe-helvetica-medium-r-normal--10-100-75-75-p-60-iso8859-1
-adobe-helvetica-medium-r-normal--10-100-75-75-p-67-iso8859-1
The font names can be used with other X client programs, such as xterm
, to specify the font to be used for displaying text.
Options
The xlsfonts
command has the following options:
Option | Description |
---|---|
-display displayname |
Specifies the X server to use. |
-fn pattern |
Specifies a pattern to match against font names. |
-ll |
Displays the font names in long format. |
-max fontname |
Specifies the maximum font name to display. |
-min fontname |
Specifies the minimum font name to display. |
-name |
Displays the font names in a more human-readable format. |
-server |
Displays the font names on the X server. |
-version |
Displays the version of the xlsfonts command. |
Troubleshooting Tips
If the xlsfonts
command is not displaying any fonts, it may be because the X server is not running or the font server is not running. You can check if the X server is running by using the ps
command:
ps aux | grep Xorg
If the font server is not running, you can start it by using the xfs
command:
xfs &
If you are still having issues, you can try specifying the X server to use with the -display
option.
Notes
The xlsfonts
command is useful for finding out what fonts are available to the X server. It can be used in conjunction with other X client programs to specify the font to be used for displaying text.