← 返回命令列表

Linux command

xlsfonts 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

List all available fonts

xlsfonts

List fonts matching a pattern

xlsfonts -fn "*courier*"

List fonts with detailed info

xlsfonts -l

List fonts on specific display

xlsfonts -display [hostname:0]

List fonts one per line

xlsfonts -1

Count available fonts

xlsfonts | wc -l

List monospace fonts

xlsfonts -fn "*-m-*"

说明

xlsfonts lists fonts available from the X server's font path. By default, it lists all fonts in multiple columns. Font names follow the X Logical Font Description (XLFD) convention with fields for foundry, family, weight, slant, width, style, pixel size, point size, resolution, spacing, average width, and character set. Patterns can include wildcards (* matches any string, ? matches single character). Common pattern uses filter by family (-fn "*helvetica*"), spacing (-fn "*-m-*" for monospace), or size.

参数

-display _HOST:DISPLAY_
Connect to specified X display.
-fn _PATTERN_
List only fonts matching pattern (wildcards supported).
-l
List fonts with minimal attributes.
-ll
List fonts with more attributes.
-lll
List fonts with all attributes.
-m
Use maximum output width (usually 79 columns).
-C
Use multiple columns.
-1
Force single column output.
-w _WIDTH_
Maximum width for multi-column output.
-n _COLUMNS_
Number of columns.
-u
Leave output unsorted.
-o
Use OpenFont/QueryFont instead of ListFonts.

FAQ

What is the xlsfonts command used for?

xlsfonts lists fonts available from the X server's font path. By default, it lists all fonts in multiple columns. Font names follow the X Logical Font Description (XLFD) convention with fields for foundry, family, weight, slant, width, style, pixel size, point size, resolution, spacing, average width, and character set. Patterns can include wildcards (* matches any string, ? matches single character). Common pattern uses filter by family (-fn "*helvetica*"), spacing (-fn "*-m-*" for monospace), or size.

How do I run a basic xlsfonts example?

Run `xlsfonts` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -display _HOST:DISPLAY_ do in xlsfonts?

Connect to specified X display.