XmbDrawText(3)
π XmbDrawText(3) β XLIB FUNCTIONS β¨
okay bestie, this is the XLIB FUNCTIONS page for XmbDrawText, XwcDrawText, and Xutf8DrawText, and it's literally about drawing text with multiple font sets. The squad is here, the font sets are shifting, and we are seated. π
π«Ά
β¨ NAME β¨
XmbDrawText, XwcDrawText, Xutf8DrawText β draw text using multiple font sets. That's the whole gig, and honestly? Iconic. π
π SYNTAX π
Here are the exact signatures, bestie β do not freestyle these, not even a little:
void XmbDrawText(Display *display, Drawable d, GC gc, int x, int y,
XmbTextItem *items, int nitems);
void XwcDrawText(Display *display, Drawable d, GC gc, int x, int y,
XwcTextItem *items, int nitems);
void Xutf8DrawText(Display *display, Drawable d, GC gc, int x, int y,
XmbTextItem *items, int nitems);
πΈ ARGUMENTS πΈ
dβ specifies the drawable. π¨displayβ specifies the connection to the X server. πgcβ specifies theGC. yes, thatGC, bestie. πitemsβ specifies an array of text items. π§Ίnitemsβ specifies the number of text items in the array. π’x,yβ specify the x and y coordinates. π
π¦ DESCRIPTION π¦
okay so XmbDrawText, XwcDrawText, and Xutf8DrawText allow complex spacing and font set shifts between text strings. It's giving coordinated text choreography, fr fr. πβ¨ Each text item is processed in turn, with the origin of a text element advanced in the primary draw direction by the escapement of the previous text item. A text item delta specifies an additional escapement of the text item drawing origin in the primary draw direction. π
A font_set member other than None in an item causes the font set to be used for this and subsequent text items in the text_items list. Leading text items with a font_set member set to None will not be drawn. π«π
Important vibe check: XmbDrawText, XwcDrawText, and Xutf8DrawText do not perform any context-dependent rendering between text segments. Clients may compute the drawing metrics by passing each text segment to XmbTextExtents, XwcTextExtents, Xutf8TextExtents or XmbTextPerCharExtents, XwcTextPerCharExtents. Xutf8TextPerCharExtents. π«‘ (And yes, every one of those names is staying exactly as written.)
When the XFontSet has missing charsets, each unavailable character is drawn with the default string returned by XCreateFontSet. π
β οΈ behavior alert: the behavior for an invalid codepoint is undefined. no cap, do not build your whole personality on that. π
Xutf8DrawText is an extension introduced by The XFree86 Project, Inc., in their 4.0.2 release. Its presence is indicated by the macro X_HAVE_UTF8_STRING. β¨π¦
π STRUCTURES π
The XmbTextItem structure contains:
typedef struct {
char *chars; /* pointer to string */
int nchars; /* number of bytes */
int delta; /* pixel delta between strings */
XFontSet font_set; /* fonts, None means don't change */
} XmbTextItem;
The XwcTextItem structure contains:
typedef struct {
wchar_t *chars; /* pointer to wide char string */
int nchars; /* number of wide characters */
int delta; /* pixel delta between strings */
XFontSet font_set; /* fonts, None means don't change */
} XwcTextItem;
π SEE ALSO π
XDrawImageString(3)XDrawString(3)XDrawText(3)XmbDrawImageString(3)XmbDrawString(3)Xlib - C Language X Interface
okay that's the whole page, bestie π«Ά this iconic little number is from X Version 11, libX11 1.8.14, with footer title XmbDrawText(3) β mwah, go draw some multi-font-set text ππ
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms