.TH xfontsel "" "" "X Utility"
.PC "Interactively select X11 fonts"
\fBxfontsel [\-\fItoolkitoption ...\^\fB] [\-pattern \fIfontname\^\fB] [\-print] [\-sample \fItext\^\fB] [\-sample16 \fItext16\^\fB] [\fB-noscaled]\fR
.PP
.HS
.SH Options:
.IC "\fB\-bd \fIcolor\fR"
Set the color of the border to \fIcolor\fR
.IC "\fB\-bg \fIcolor\fR"
Set the color of the background to \fIcolor\fR
.IC "\fB\-bw \fIpixels\fR"
Set the width of the border to \fIpixels\fR
.IC "\fB\-display \fIhost\^\fB[:\fIserver\^\fB][.\fIscreen\^\fB]\fR"
Display the client's window on screen number \fIscreen\fR
of \fIserver\fR on host system \fIhost\fR
.IC "\fB\-fg \fIcolor\fR"
Set the color of the foreground to \fIcolor\fR
.IC "\fB\-fn \fIfont\fR"
Use \fIfont\fR in the display
.IC "\fB\-geometry \fIgeometry\fR"
Set the geometry of the program's window to \fIgeometry\fR
.IC \fB\-noscaled\fR
Disable the ability of
.B xfontsel
to select scaled fonts at arbitrary pixel or point sizes
.IC "\fB-pattern \fIfont\fR"
Examine
.I font
.IC \fB-print\fR
Write the selected font specifier to standard output when you click the
.B quit
button
.IC \fB\-rv\fR
Simulate reverse video by exchanging the foreground and background colors
.IC "\fB\-sample \fItext\fR"
Set the sample text to be used to display the selected font
if the font is linearly indexed
.IC "\fB\-sample16 \fItext16\fR"
Set the sample text to be used to display the selected font
if the font is matrix encoded
.IC "\fB\-xrm \fIresourcestring\fR"
Use \fIresourcestring\fR to define a resource
.HE
.II XLFD
.II "X Logical Font Description"
.II "font^select"
.B xfontsel
provides a simple way to display the fonts known to your X server,
examine samples of each, and retrieve the full X Logical Font Description (XLFD)
for a font.
.SH Options
.B xfontsel
recognizes the following command-line options:
.IP "\fB\-bd \fIcolor\fR" 0.75i
Set the color of the border to
.IR color .
.IP "\fB\-bg \fIcolor\fR"
Set the color of the background to
.IR color .
.IP "\fB\-bw \fIpixels\fR"
Set the width of the border to
.IR pixels .
.IP "\fB\-display \fIhost\^\fB[:\fIserver\^\fB][.\fIscreen\^\fB]\fR"
Display the client's window on screen number
.I screen
of
.I server
on host system
.IR host .
.IP "\fB\-fg \fIcolor\fR"
Set the color of the foreground to
.IR color .
.IP "\fB\-fn \fIfont\fR"
Use
.I font
in the display.
.IP "\fB\-geometry \fIgeometry\fR"
Set the geometry of the program's window to
.IR geometry .
The term ``geometry'' means the dimensions of the window and its location
on the screen.
.I geometry
has the form \fIwidth\(muheight\(+-xoffset\(+-yoffset\fR.
.IP \fB\-noscaled\fR
Disable the ability of
.B xfontsel
to select scaled fonts at arbitrary pixel or point sizes.
This makes it clear which bitmap sizes are advertised by the server,
and can avoid an accidental and sometimes prolonged wait
for a font to be scaled.
.IP "\fB\-pattern \fIfont\fR"
Examine
.IR font .
If you do not use this option,
you can select interactively from among all
all fonts with XLFD 14-part names.
To work with only a subset of the
fonts, specify \fB-pattern\fP followed by a partially or fully
qualified font name; e.g.,
.DM
	-pattern \e*medium\e*
.DE
.IP
selects a font only if its name contains the string.
Be careful to escape wildcard characters so the \*(CO shell does not
interpret them.
.IP \fB\-print\fR
Write the selected font specifier to standard output when you click the
.K quit
button.
Regardless of whether you have specified \fB\-print\fR,
you can make the font specifier the primary (text) selection by clicking the
.K select
button.
.IP \fB\-rv\fR
Simulate reverse video by exchanging the foreground and background colors.
.IP "\fB\-sample \fItext\fR"
Set the sample text to be used to display the selected font
if the font is linearly indexed.
.IP "\fB\-sample16 \fItext16\fR"
Set the sample text to be used to display the selected font
if the font is matrix encoded.
.IP "\fB\-xrm \fIresourcestring\fR"
Use
.I resourcestring
to define a resource.
.SH Interactions
When you invoke
.BR xfontsel ,
it draws the following window on your screen:
.PH 1 1 \*(XD/xfontsel.eps
As you can see, the window is divided into four areas:
.IP \(bu 0.3i
The top area displays
.K quit
and
.K select
buttons, and a message about the number of fonts that match the description
you entered.
.IP \(bu
The second area displays 14 buttons, one for each field in a font's XLFD name.
Clicking on one of these buttons presents the possibile entries for the
corresponding XLFD field.
When you select an item from a menu,
.B xfontsel
limits the items available in all other menus to those which
correlate with what you have already selected;
to make other values selectable, you must first de-select
some other field or fields by choosing the `*' entry in its menu.
To omit some values altogether, set the resource
.BR ShowUnselectable ,
as described below.
These buttons are described below.
.IP \(bu
The third field displays the XLFD name.
Unless you have narrowed the selection of fonts, each of the 14 fields
is represented by an asterisk, separated by an underscore.
.IP \(bu
The bottom displays a font, as constructed from the XLFD entered in the
above two fields.
.PP
The following describes the 14 buttons in the second field of the screen.
These buttons define, in order, the 14 fields in a font's XLFD name,
as follows:
.IP \fK(fndry)\fR
Foundry:
the company that made the fonts, e.g., Bitstream or Adobe.
.IP \fK(fmly)\fR
Family:
the family of typefaces, e.g.,
.B courier
or
.BR gothic .
.IP \fK(wght)\fR
Weight of the typeface, e.g.,
.B bold
or
.BR medium .
.IP \fK(slant)\fR
The angularity of the font.
.B nil
indicates nothing \(em that is, no typeface;
.BR i ,
italic;
.BR o ,
slanted Roman;
and
.BR r ,
Roman.
.IP \fK(sWdth)\fR
Set width of the face, that is, how closely the characters are set next to each
other.
.B normal
indicates normal width;
.B semicondensed
sets the text somewhat more tightly.
.IP \fK(adstyl)\fR
The style of text:
.B sans
indicates a sans-serif face.
.IP \fK(pxlsz)\fR
Pixel size:
the size of the face in pixels.
.IP \fK(ptSz)\fR
Point size:
the size of the font in decipoints \(em that is, tenths of a printer's point.
There are 720 decipoints per inch.
.IP \fK(resx)\fR
Horizontal (X) resolution, in pixels per inch.
.IP \fK(resy)\fR
Vertical (Y) resolution, in pixels per inch.
.IP \fK(spc)\fR
Spacing; for example,
.B m
indicates monospace.
.IP \fK(avgWdth)\fR
Average width, in tenths of a pixel.
.IP \fK(rgstry)\fR
Registry, that is, the organization that registered the character set
embodied in this font.
.IP \fK(encdng)\fR
Encoding:
the name of character set embodied in this font.
.II ISO-8859-1
.II "ISO Latin 1"
Note that the commonest character set is ISO-8859-1, also called
ISO Latin 1, which
describes the ASCII character set normally used in the United States.
.PP
Whenever you change the value of an XLFD field,
.B xfontsel
assert ownership of the
.B primary_font
property.
Other applications (see, e.g.,
.BR xterm )
can then retrieve the specified font.
.PP
Scalable fonts come back from the server with zero for the pixel size,
point size, and average width fields.
Selecting a font name with a zero in these positions results in an
implementation-dependent size.
Any pixel or point size can be selected to scale the font to a particular size.
Any average width can be selected to scale the font anamorphically
(although you may find this challenging given the size of the
average width menu).
.PP
Clicking the left pointer button in the \fK(select)\fR button
causes the currently selected font name to become the primary text selection,
as well as the
.B primary_font
selection.
This allows you to paste the string into other applications.
The \fK(select)\fR button remains highlighted to remind you of this fact;
it de-highlights when some other application seizes the primary selection.
The \fK(select)\fR button is a toggle:
pressing it when it is highlighted causes
.B xfontsel
to release ownership of the selection and de-highlight the button.
Clicking the \fK(select)\fR widget twice
is the only way to force
.B xfontsel
to release the
.B primary_font
selection.
.SH Resources
The application's class is
.BR XFontSel .
Most of its user interface is configured in the configuration file
.BR /usr/X11/lib/app-defaults/XFontSel .
If this file is missing,
.B xfontsel
prints a warning message to standard output, and the
resulting window will be nearly incomprehensible.
.PP
The following gives application-specific resources:
.IP "\fBcursor (\fRclass\fB Cursor)\fR"
Set the cursor for the application window.
.IP "\fBpattern (\fRclass\fB Pattern)\fR"
Set the font-name pattern to select a subset of available fonts.
This is equivalent to the command-line option \fB\-pattern\fR.
Most useful patterns contain at least one field
delimiter; e.g., ``*-m-*'' for monospaced fonts.
.IP "\fBpixelSizeList (\fRclass\fB PixelSizeList)\fR"
Give a list of pixel sizes to add to the pixel-size menu,
so that scalable fonts can be selected at those pixel sizes.
The default
.B pixelSizeList
contains 7, 30, 40, 50, and 60.
.IP "\fBpointSizeList (\fRclass\fB PointSizeList)\fR"
Give a list of point sizes (in units of tenths of points) to add to
the point size menu, so that scalable fonts can be selected at those
point sizes.
The default
.B pointSizeList
contains 250, 300, 350, and 400.
.IP "\fBprintOnQuit (\fRclass\fB PrintOnQuit)\fR"
If set to
.BR True ,
the currently selected font name is printed
to standard output when you click the \fK(quit)\fR button.
Equivalent to the \fB\-print\fR option.
.IP "\fBsampleText (\fRclass\fB Text)\fR"
The sample one-byte text to use for linearly indexed fonts.
Each glyph index is a single byte, with a newline character separating lines.
.IP "\fBsampleText16 (\fRclass\fB Text16)\fR"
The sample two-byte text to use for matrix-encoded fonts.
Each glyph index is two bytes, with a newline character separating lines.
.IP "\fBscaledFonts (\fRclass\fB ScaledFonts)\fR"
If set to
.BR True ,
enable selection of arbitrary pixel and point sizes for scalable fonts.
.PP
The following gives the widget resources used by
.BR xfontsel :
.IP "\fBshowUnselectable (\fRclass\fB ShowUnselectable)\fR"
For each field menu, indicate whether to show values that
are not currently selectable, based upon previous field selections.
If shown, the unselectable values are clearly identified as such
and do not highlight when the pointer is moved down the menu.
The full name of this resource is
.DM
	field\fIN\fP.menu.options.showUnselectable
.DE
.IP
of class:
.DM
	MenuButton.SimpleMenu.Options.ShowUnselectable
.DE
.IP
where
.I N
is replaced with the field number (starting with the left-most field, which
is numbered zero).
The default is
.B True
for all but field 11 (average width of characters in font)
and
.B False
for field 11.
If you never want to see unselectable entries,
.DM
	*menu.options.showUnselectable:False
.DE
.IP
is a reasonable entry for your personal resource file.
.SH Files
\fB/usr/X11/lib/app-defaults/XFontSel\fR \(em Resource file
.SH "See Also"
.B
xfd,
xrdb,
X utilities
.R
.SH Notes
Sufficiently ambiguous patterns can be misinterpreted and lead to an
initial selection string that may not correspond to what you intended,
and that may cause the initial sample text output to fail to match
the proffered string.
Selecting any new field value corrects the
sample output, though possibly resulting in no matching font.
.PP
When running on a slow machine, you may
request a field menu before the font names have been completely parsed.
.B xfontsel
prints to the standard error an error message that indicates a missing menu,
but otherwise nothing happens.
.PP
Copyright \(co1989, 1991 by the Massachusetts Institute of Technology
.PP
.II "Swick, Ralph R."
.B xfontsel
was written by
Ralph R. Swick of Digital Equipment Corporation/MIT Project Athena.
