XLoadFont()XLoadFont()NameXLoadFont – load a font if not already loaded; get font ID.
Synopsis
Font XLoadFont(display, name)
Display *display;
char *name;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
name Specifies the name of the font in a NULL-terminated string.
As of Release 4, the * and ? wildcards are allowed and may be
supported by the server. Uppercase or lowercase is not
important. If the font name is not in the Host Portable
Character Encoding, the result is implementation-dependent.
Returns
The Font ID.
DescriptionXLoadFont() loads a font into the server if it has not already been
loaded by another client. XLoadFont() returns the font ID or, if it
was unsuccessful, generates a BadName error. When the font is no
longer needed, the client should call XUnloadFont(). Fonts are not
associated with a particular screen. Once the font ID is available, it
can be set in the font member of any GC, and thereby used in subsequent
drawing requests.
Font information is usually necessary for locating the text. Call
XLoadFontWithInfo() to get the info at the time you load the font, or
call XQueryFont() if you used XLoadFont() to load the font.
For more information on fonts, see Volume One, Chapter 6, Drawing
Graphics and Text.
Errors
BadAlloc Server has insufficient memory to store font.
BadName name specifies an unavailable font.
See AlsoXCreateFontCursor(), XFreeFont(), XFreeFontInfo(), XFreeFontNames(),
XFreeFontPath(), XGetFontPath(), XGetFontProperty(), XListFonts(),
XListFontsWithInfo(), XLoadQueryFont(), XQueryFont(), XSetFont(), XSet‐
FontPath(), XUnloadFont().
Xlib - Fonts XLoadFont()