XLoadFont(3X) — X Version 11
NAME
XLoadFont, XQueryFont, XListFontsWithInfo, XFreeFontInfo, XLoadQueryFont, XFreeFont, XGetFontProperty, XUnloadFont, XGContextFromGC − manipulate fonts
SYNTAX
Font XLoadFont(display, name)
Display ∗display;
char ∗name;
XFontStruct ∗XQueryFont(display, font_ID)
Display ∗display;
XID font_ID;
char ∗∗XListFontsWithInfo(display, pattern, maxnames, count_return, info_return)
Display ∗display;
char ∗pattern;
int maxnames;
int ∗count_return;
XFontStruct ∗∗info_return;
XFreeFontInfo(names, free_info, actual_count)
char ∗∗names;
XFontStruct ∗free_info;
int actual_count;
XFontStruct ∗XLoadQueryFont(display, name)
Display ∗display;
char ∗name;
XFreeFont(display, font_struct)
Display ∗display;
XFontStruct ∗font_struct;
Bool XGetFontProperty(font_struct, atom, value_return)
XFontStruct ∗font_struct;
Atom atom;
unsigned long ∗value_return;
XUnloadFont(display, font)
Display ∗display;
Font font;
GContext XGContextFromGC(gc)
GC gc;
ARGUMENTS
actual_countMust be the actual number of matched font names returned by XListFontsWithInfo.
atomSpecifies the atom associated with the string name you want returned.
count_returnReturns the actual number of matched font names.
displaySpecifies the connection to the X server.
fontSpecifies the font ID.
font_IDSpecifies the ID of the font or the graphics context.
gcSpecifies the graphics context that you want the resource for.
font_structSpecifies the storage associated with the font.
info_returnReturns a pointer to the font information.
free_infoMust be the pointer to font information returned by XListFontWithInfo.
maxnamesSpecifies the maximum number of names that are to be in the returned list.
nameSpecifies the name of the font. This name is a null terminated string.
namesMust be the list of font names returned by XListFontsWithInfo.
patternSpecifies the null-terminated string associated with the font names that you want returned. You can specify any string, an asterisk “∗”, or a question mark “?”. The asterisk indicates a wildcard on any number of characters, and the question mark indicates a wildcard on a single character.
value_returnReturns the value of the font property.
DESCRIPTION
The XLoadFont function loads the specified font and returns its associated font ID. .PN XLoadFont can generate BadAlloc and BadName errors.
The XQueryFont function returns a pointer to the XFontStruct structure, which contains information associated with the font. .PN XLoadQueryFont can generate a BadAlloc error.
The XListFontsWithInfo function returns a list of names of fonts that match the specified pattern and their associated font information.
The XFreeFontInfo function frees the the font information array.
The XLoadQueryFont function provides the most common way for accessing a font. That is, XLoadQueryFont both opens (loads) the specified font and returns a pointer to the appropriate XFontStruct structure.
The XFreeFont function deletes the association between the font resource ID and the specified font. The font itself will be freed when no other resource references it. The data and the font should not be referenced again. .PN XFreeFont can generate a BadFont error.
Given the atom for that property, the XGetFontProperty function returns the value of the specified font property. The function returns zero if the atom was not defined or one if it was defined.
The XUnloadFont function deletes the association between the font resource ID and the specified font. .PN XUnloadFont can generate a BadFont error.
DIAGNOSTICS
BadAlloc The server failed to allocate the requested resource or server memory.
BadFont A value for a Font or GContext argument does not name a defined Font.
BadName A font or color of the specified name does not exist.
SEE ALSO
XListFonts(3X), XSetFontPath(3X)
Xlib − C Language X Interface
1 March 1988