GNU Info

Info Node: (elisp)Font Lookup

(elisp)Font Lookup


Next: Fontsets Prev: Auto Faces Up: Faces
Enter node , (file) or (file)node

Looking Up Fonts
----------------

 - Function: x-list-fonts pattern &optional face frame maximum
     This function returns a list of available font names that match
     PATTERN.  If the optional arguments FACE and FRAME are specified,
     then the list is limited to fonts that are the same size as FACE
     currently is on FRAME.

     The argument PATTERN should be a string, perhaps with wildcard
     characters: the `*' character matches any substring, and the `?'
     character matches any single character.  Pattern matching of font
     names ignores case.

     If you specify FACE and FRAME, FACE should be a face name (a
     symbol) and FRAME should be a frame.

     The optional argument MAXIMUM sets a limit on how many fonts to
     return.  If this is non-`nil', then the return value is truncated
     after the first MAXIMUM matching fonts.  Specifying a small value
     for MAXIMUM can make this function much faster, in cases where
     many fonts match the pattern.

   These additional functions are available starting in Emacs 21.

 - Function: x-family-fonts &optional family frame
     This function returns a list describing the available fonts for
     family FAMILY on FRAME.  If FAMILY is omitted or `nil', this list
     applies to all families, and therefore, it contains all available
     fonts.  Otherwise, FAMILY must be a string; it may contain the
     wildcards `?' and `*'.

     The list describes the display that FRAME is on; if FRAME is
     omitted or `nil', it applies to the selected frame's display
     (Note: Input Focus).

     The list contains a vector of the following form for each font:

          [FAMILY WIDTH POINT-SIZE WEIGHT SLANT
           FIXED-P FULL REGISTRY-AND-ENCODING]

     The first five elements correspond to face attributes; if you
     specify these attributes for a face, it will use this font.

     The last three elements give additional information about the font.
     FIXED-P is non-nil if the font is fixed-pitch.  FULL is the full
     name of the font, and REGISTRY-AND-ENCODING is a string giving the
     registry and encoding of the font.

     The result list is sorted according to the current face font sort
     order.

 - Function: x-font-family-list &optional frame
     This function returns a list of the font families available for
     FRAME's display.  If FRAME is omitted or `nil', it describes the
     selected frame's display (Note: Input Focus).

     The value is a list of elements of this form:

          (FAMILY . FIXED-P)

     Here FAMILY is a font family, and FIXED-P is non-`nil' if fonts of
     that family are fixed-pitch.

 - Variable: font-list-limit
     This variable specifies maximum number of fonts to consider in font
     matching.  The function `x-family-fonts' will not return more than
     that many fonts, and font selection will consider only that many
     fonts when searching a matching font for face attributes.  The
     default is currently 100.


automatically generated by info2www version 1.2.2.9