xfd
Display X font information
SYNOPSIS
xfd [-options ...] -fn fontname
xfd [-options ...] -font fontname
PARAMETERS
-fn fontname or -font fontname
Specifies the X font to display. This option is mandatory and accepts either an X Logical Font Description (XLFD) name or a font alias.
-info
Displays detailed font properties and metrics for the entire font, such as ascent, descent, min/max bounds, and default character.
-verbose
Provides extensive font metrics information for each character displayed, including its width, left bearing, right bearing, and ascent/descent.
-start character
Sets the character code from which the display should begin. The character can be specified as a decimal, octal (0 prefix), or hexadecimal (0x prefix) number.
-end character
Specifies the last character code to display, useful for examining a subset of the font.
-rows number
Defines the number of rows of characters to display in the window. Must be a positive integer.
-columns number
Defines the number of columns of characters to display in the window. Must be a positive integer.
-pixmap
Uses a pixmap to draw the characters, which can make the display process faster, especially for large fonts or remote X connections.
-box
Draws a bounding box around each character, illustrating its precise dimensions and placement within its character cell.
-center
Centers characters within their display cells, which can be useful when inspecting characters that don't fill their cell.
-scale factor
Scales the font by the specified floating-point factor. Useful for seeing characters larger or smaller than their native size.
-display display
Specifies the X server display to connect to (e.g., :0.0, localhost:1.0).
-fg color
Sets the foreground color for displaying characters (e.g., 'red', '#RRGGBB').
-bg color
Sets the background color for the display window (e.g., 'white', 'black').
DESCRIPTION
xfd (X Font Displayer) is a utility program for the X Window System that allows users to display all characters in an X font. It provides a visual representation of each character's glyph, its corresponding character code, and optionally, detailed font metrics. This tool is particularly useful for font designers, developers, and users who need to inspect the contents of a specific X11 font file, verify character mappings, or understand the spacing and bounding box of characters within a font.
While modern Linux systems often rely on Fontconfig and FreeType for rendering scalable fonts like TrueType and OpenType, xfd remains a valuable tool for understanding and debugging issues related to traditional X11 bitmap fonts or when working directly with the X server's core font system. It helps in visualizing character sets, identifying missing glyphs, or confirming the exact appearance of characters that are loaded by the X server.
CAVEATS
xfd primarily works with the traditional X11 core fonts (bitmap fonts or server-side scalable fonts). It is less relevant for fonts managed by modern font rendering stacks like Fontconfig and FreeType, which handle TrueType and OpenType fonts client-side. While it can display some scalable fonts if the X server supports them and they are properly aliased, its primary strength lies in inspecting legacy X11 fonts. Users should be aware that the character codes displayed correspond to the encoding of the specified font, not necessarily Unicode.
INTERACTIVE DISPLAY
Once xfd starts, the display window is interactive. Users can click on a character to see its character code and detailed metrics at the bottom of the window. Arrow keys (left/right, up/down), Page Up/Down, Home, and End keys can be used to navigate through the characters in the font, providing a dynamic way to explore the font's content.
FONT NAMING CONVENTIONS
xfd requires fonts to be specified using the X Logical Font Description (XLFD) name or a font alias. Examples include -fn fixed or a full XLFD string like -fn '-*-fixed-medium-r-normal--14-*-*-*-*-*-iso8859-1'. Users can use xlsfonts to list available fonts and their XLFD names, or xfontsel for interactive XLFD string generation, to ensure proper font selection with xfd.
HISTORY
xfd has been a fundamental utility within the X Window System distribution since its early versions, tracing back to X11R1 and X11R2. It was developed as a direct tool for inspecting the bitmap fonts that were central to X's original rendering model. Its existence highlights the importance of understanding font metrics and glyph shapes in the early days of graphical user interfaces on Unix-like systems. Though font technologies have evolved, xfd remains a testament to the enduring architecture of X11 core fonts and is still included in most X.Org distributions.