XmbDrawString(3)

✨ XmbDrawString(3) β€” XLIB FUNCTIONS ✨

okay bestie, we’re in XLIB FUNCTIONS territory and the main character is XmbDrawString(3). Let’s get into it. πŸ’…

πŸŽ€ NAME πŸŽ€

XmbDrawString, XwcDrawString, Xutf8DrawString β€” draw text using a single font set. That’s the whole assignment, no cap. πŸ’–

πŸ¦‹ SYNTAX πŸ¦‹

Here’s the exact spellbook, bestie β€” copy these signatures character for character:

void XmbDrawString(Display *display, Drawable d, XFontSet font_set, GC gc, int x, int y, _Xconst char *string, int num_bytes);

void XwcDrawString(Display *display, Drawable d, XFontSet font_set, GC gc, int x, int y, _Xconst wchar_t *string, int num_wchars);

void Xutf8DrawString(Display *display, Drawable d, XFontSet font_set, GC gc, int x, int y, _Xconst char *string, int num_bytes);

🌈 ARGUMENTS 🌈

Every parameter gets its moment, because we do not skip the supporting cast:

  • d β€” specifies the drawable. πŸ–ΌοΈ
  • display β€” specifies the connection to the X server. πŸ”Œ
  • font_set β€” specifies the font set. πŸ”€
  • gc β€” specifies the GC. 🎨
  • num_bytes β€” specifies the number of bytes in the string argument. πŸ”’
  • num_wchars β€” specifies the number of characters in the string argument. πŸ”’
  • string β€” specifies the character string. πŸ’¬
  • x, y β€” specify the x and y coordinates. πŸ“

πŸ’– DESCRIPTION πŸ’–

XmbDrawString, XwcDrawString, and Xutf8DrawString draw the specified text with the foreground pixel. Slay. 🎨✨

When the XFontSet has missing charsets, each unavailable character is drawn with the default string returned by XCreateFontSet. That’s the fallback situation. 🫢

The behavior for an invalid codepoint is undefined. This is the danger zone, bestie β€” undefined behavior means don’t count on a cute outcome. πŸ’€

The function Xutf8DrawString is an extension introduced by The XFree86 Project, Inc., in their 4.0.2 release. Iconic behavior from the XFree86 girlies. 🌟 Its presence is indicated by the macro X_HAVE_UTF8_STRING. iykyk. 🧚

🌟 SEE ALSO 🌟

Go read these next, bestie β€” the whole friend group is here:


xoxo, your Unix bestie πŸ’– This was the XmbDrawString(3) page from X Version 11, libX11 1.8.14. Bye, love you, go draw some text! πŸŽ€βœ¨

πŸ“¦ where this page comes from