xcb_open_font(3)

πŸ“¦
version 1.17.0 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– xcb_open_font β€” the XCB Requests girlies' guide πŸ’–

okay so bestie, welcome to the xcb_open_font(3) page β€” yes it's a section 3 manual, yes it's from the XCB Requests fam, and yes it is literally just about opening a font. iconic behavior honestly. let's get into it πŸŽ€


✨ NAME ✨

xcb_open_font β€” opens a font 🌸


✨ SYNOPSIS ✨

first things first, you gotta bring in the header, no cap:

#include <xcb/xproto.h>

πŸ¦‹ Request function

here's the whole vibe, character for character, don't come for me:

xcb_void_cookie_t xcb_open_font(xcb_connection_t *conn, xcb_font_t fid,
       uint16_t name_len, const char *name);

✨ REQUEST ARGUMENTS ✨

  • conn β€” the XCB connection to X11. it's your link to the server, your main character connection fr 🫢
  • fid β€” the ID you'll use to refer to this font later. you make it with xcb_generate_id. don't just make one up, bestie, that's not the move πŸ’…
  • name_len β€” length (in bytes) of name. yes, bytes, not vibes. count carefully πŸ‘‘
  • name β€” a pattern describing an X core font. it's giving "search query but for fonts" ✨

✨ DESCRIPTION ✨

so what does it actually do? it opens any X core font matching the name you give it β€” for example:

"-misc-fixed-*"

that's the classic little star-wildcard moment. slay ⭐

okay so lowkey important: X core fonts are deprecated (but still supported) in favor of client-side rendering using Xft. so they still work, they're just not the moment anymore. use them if you must, but know the lore 😭

✨ RETURN VALUE ✨

it hands you back an xcb_void_cookie_t. and here's the thing β€” errors (if there are any) have to be handled in the event loop, not right here. so no peeking, you gotta wait for the loop like everyone else πŸ™ˆ

if you'd rather handle errors directly with xcb_request_check instead, then use xcb_open_font_checked β€” that's your checked-girlie option. see xcb-requests(3) for the details πŸ’œ


✨ ERRORS ✨

  • xcb_name_error_t β€” no font matches the given name. that's it, that's the error. your pattern found nobody home πŸ’€

✨ SEE ALSO ✨


✨ AUTHOR ✨

generated from xproto.xml. contact xcb@lists.freedesktop.org for corrections and improvements β€” they said it, not me 🫢


and that's the whole page, bestie!! this cutie came to you from X Version 11, rocking libxcb 1.17.0, filed under xcb_open_font(3). now go open that font, periodt. πŸ’…βœ¨πŸŽ€