XFD(1)

๐Ÿ“ฆ
version 7.7+7build1 ยท 4 versions
, in debian trixie, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

๐ŸŽ€ XFD(1) ๐ŸŽ€

โœจ NAME โœจ

okay so the manual name is XFD(1), and the tool is xfd, which displays all the characters in an X font ๐Ÿ’–

๐Ÿงš SYNOPSIS ๐Ÿงš

xfd [-options ...] -fn fontname

xfd [-options ...] -fa fontname

๐Ÿ’… DESCRIPTION ๐Ÿ’…

bestie, the xfd utility makes a window for you ๐ŸชŸ It shows the name of the font being displayed, a row of command buttons, a few lines of text with character metrics, and a grid with one glyph per cell ๐ŸŒธ Characters go in increasing order, left to right, then top to bottom. The top left cell starts at character number 0, unless you pass -start, in which case it starts at whatever number you gave it โœจ

The grid is made of boxes, and every box is big enough to hold any single character in the font ๐Ÿ“ฆ Each glyph gets drawn with the PolyText16 request (the one used by the Xlib routine XDrawString16) or with the XftDrawString32 routine. Which one you get depends on whether you used -fn or -fa ๐Ÿฆ‹ If you add -box, each character gets a rectangle around it, showing exactly where an ImageText16 request (the one used by the Xlib routine XDrawImageString16) would paint background color ๐ŸŽจ

Normally each glyph sits in the upper left corner of its grid cell. But if a glyph has a negative left bearing, or an unusually large ascent, descent, or right bearing (cursor font is a total diva about this ๐Ÿ™ˆ), some characters won't show up in their own cells. Use -center to force every glyph into the middle of its cell ๐Ÿซถ

Not every character fits in the window at once, so there are pages. Press the Next button at the top of the window to see the next page, Prev to go back, and Quit to leave xfd ๐Ÿ‘‹

Click on any character and its metrics show up at the top of the window: index, width, bearings, ascent and descent ๐Ÿ”

The font name at the top is the full name of the font, as the server decides it. If you want lists of fonts plus more detailed metrics and properties, check out xlsfonts and fc-list ๐Ÿ“š

๐ŸŒˆ OPTIONS ๐ŸŒˆ

xfd takes all the standard toolkit command line options, plus the extra ones below ๐Ÿ’œ

  • -fn font โ€” picks the core X server side font to display ๐Ÿ–ค You can also set this with the FontGrid font resource. A font has to be specified, no skipping!
  • -fa font โ€” picks a Xft font to display instead ๐Ÿ’ซ You can also set this with the FontGrid face resource. You have to give a font pattern here.
  • -box โ€” draws a box around the area that an ImageText request would fill with background color ๐Ÿ“ฆ You can also set it with the FontGrid boxChars resource. Default is False.
  • -center โ€” centers each glyph inside its grid cell ๐ŸŽฏ You can also set it with the FontGrid centerChars resource. Default is False.
  • -start number โ€” sets the glyph index for the upper left corner of the grid ๐Ÿ”ข This is how you peek at characters sitting anywhere in the font. You can also set it with the FontGrid startChar resource. Default is 0.
  • -bc color โ€” the color used when ImageText boxes get drawn ๐ŸŽจ You can also set it with the FontGrid boxColor resource.
  • -rows numrows โ€” sets how many rows the grid has ๐Ÿ“ You can also set it with the FontGrid cellRows resource.
  • -columns numcols โ€” sets how many columns the grid has ๐Ÿ“ You can also set it with the FontGrid cellColumns resource.

๐Ÿง WIDGETS ๐Ÿง

ngl, it helps to know the widgets that make up xfd if you're setting resources. In the notation below, indentation shows the hierarchy ๐Ÿช† Each line gives the widget class name first, then the widget instance name. The application class name is Xfd.

Xfd  xfd
     Paned  pane
          Label  fontname
          Box  box
               Command  quit
               Command  prev
               Command  next
          Label  select
          Label  metrics
          Label  range
          Label  start
          Form  form
               FontGrid  grid

๐Ÿซง FONTGRID RESOURCES ๐Ÿซง

The FontGrid widget is application-specific ๐Ÿงฉ It's a subclass of the Simple widget from the Athena widget set. Its resources have their effects and instance names listed in the OPTIONS section. To get the class name, capitalize the first letter of the instance name ๐Ÿ’…

๐Ÿฆ„ APPLICATION SPECIFIC RESOURCES ๐Ÿฆ„

Here are the instance names of the application specific resources. Same trick as before: capitalize the first letter of the instance name to get the class name. These are not going to be super exciting unless you're localizing xfd for another language ๐ŸŒ

  • selectFormat โ€” a printf-style format string that shows info about the selected character ๐Ÿ”Ž The default is "character 0x%02x%02x (%u,%u) (%#o,%#o)". The arguments after the format string are char.byte1, char.byte2, char.byte1, char.byte2, char.byte1, char.byte2. Here char.byte1 is byte 1 of the selected character, and char.byte2 is byte 2 of it.
  • metricsFormat โ€” a printf-style format string for the character metrics ๐Ÿ“Š The default is "width %d; left %d, right %d; ascent %d, descent %d (font %d, %d)". The arguments after it are the character metrics width, lbearing, rbearing, character ascent, character descent, font ascent, and font descent.
  • rangeFormat โ€” a printf-style format string for the range of characters on screen right now ๐Ÿ—บ๏ธ The default is "range: 0x%02x%02x (%u,%u) thru 0x%02x%02x (%u,%u)". The arguments after it are these fields from the XFontStruct you get back when opening the font: min_byte1, min_char_or_byte2, min_byte1, min_char_or_byte2, max_byte1, max_char_or_byte2, max_byte1, max_char_or_byte2.
  • startFormat โ€” a printf-style format string for the character in the upper left corner of the font grid ๐ŸŒท The default is "upper left: 0x%04x (%d,%d)". The arguments after it are the new character, the high byte of the new character, and the low byte of the new character.
  • nocharFormat โ€” a printf-style format string shown when the selected character doesn't exist ๐Ÿ™… The default is "no such character 0x%02x%02x (%u,%u) (%#o,%#o)". The arguments after it are the same as for the selectFormat resource.

๐Ÿ”— SEE ALSO ๐Ÿ”—

X(7), xlsfonts(1), xrdb(1), xfontsel(1), fc-list(1), fonts.conf(5), X Logical Font Description Conventions ๐Ÿ“–

๐Ÿ› BUGS ๐Ÿ›

the program should skip over pages full of non-existent characters. right now it doesn't, so you might be stuck staring at empty pages ๐Ÿ’€

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Jim Fulton, MIT X Consortium ๐ŸŒŸ The previous program with the same name was by Mark Lillibridge, MIT Project Athena ๐Ÿซถ


โœจ X Version 11, xfd 1.1.4, XFD(1) โœจ that's the whole tea, bestie. now go be iconic ๐Ÿ’œ๐Ÿ’…๐Ÿฆ‹