XListFonts

Syntax

char **XListFonts(display, pattern, maxnames, actual_count_return)
      Display *display;
      char *pattern;
      int maxnames;
      int *actual_count_return;

Arguments

display Specifies the connection to the X server.
pattern Specifies the null-terminated pattern string that can contain wildcard characters.
maxnames Specifies the maximum number of names to be returned.
actual_count_return Returns the actual number of font names.

Description

The XListFonts() function returns an array of available font names (as controlled by the font search path; see XSetFontPath()) that match the string you passed to the pattern argument. The pattern string can contain any characters, but each asterisk (*) is a wildcard for any number of characters, and each question mark (?) is a wildcard for a single character. If the pattern string is not in the Host Portable Character Encoding, the result is implementation dependent. Use of uppercase or lowercase does not matter. Each returned string is null-terminated. If the data returned by the server is in the Latin Portable Character Encoding, then the returned strings are in the Host Portable Character Encoding. Otherwise, the result is implementation dependent. If there are no matching font names, XListFonts() returns NULL. The client should call XFreeFontNames() when finished with the result to free the memory.

See also

XFreeFontInfo(), XFreeFontNames(), XListFontsWithInfo(), XLoadFont(), XSetFontPath(), "Obtaining and Freeing Font Names and Information".
Christophe Tronche, ch@tronche.com