1. NAME▲
XListFonts, XFreeFontNames, XListFontsWithInfo, XFreeFontInfo - obtain or free font names and information
2. SYNTAX ▲
char **XListFonts(Display *display, char *pattern, int maxnames, int *actual_count_return); int XFreeFontNames(char *list[]); char **XListFontsWithInfo(Display *display, char *pattern, int maxnames, int *count_return, XFontStruct **info_return); int XFreeFontInfo(char **names, XFontStruct *free_info, int actual_count);
3. ARGUMENTS ▲
actual_count 1i Specifies the actual number of font names.
actual_count_return 1i Returns the actual number of font names.
count_return 1i Returns the actual number of matched font names.
display 1i Specifies the connection to the X server.
info_return 1i Returns the font information.
free_info 1i Specifies the font information.
list 1i Specifies the array of strings you want to free.
maxnames 1i Specifies the maximum number of names to be returned.
names 1i Specifies the list of font names.
pattern 1i Specifies the null-terminated pattern string that can contain wildcard characters.
4. DESCRIPTION ▲
The .ZN XListFonts function returns an array of available font names (as controlled by the font search path; see .ZN 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, .ZN XListFonts returns NULL. The client should call .ZN XFreeFontNames when finished with the result to free the memory.
The .ZN XFreeFontNames function frees the array and strings returned by .ZN XListFonts or .ZN XListFontsWithInfo .
The .ZN XListFontsWithInfo function returns a list of font names that match the specified pattern and their associated font information. The list of names is limited to size specified by maxnames. The information returned for each font is identical to what .ZN XLoadQueryFont would return except that the per-character metrics are not returned. 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, .ZN XListFontsWithInfo returns NULL.
To free only the allocated name array, the client should call .ZN XFreeFontNames . To free both the name array and the font information array or to free just the font information array, the client should call .ZN XFreeFontInfo .
The .ZN XFreeFontInfo function frees a font structure or an array of font structures and optionally an array of font names. If NULL is passed for names, no font names are freed. If a font structure for an open font (returned by .ZN XLoadQueryFont ) is passed, the structure is freed, but the font is not closed; use .ZN XUnloadFont to close the font.
Note that .ZN XListFontsWithInfo is not thread-safe. If other threads make X requests on the same .ZN Display , then this function's behavior is undefined.
5. SEE ALSO ▲
XLoadFont(3), XSetFontPath(3)
\*(xL