xcb_query_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_query_font(3) πŸ’–

okay so bestie, welcome to xcb_query_font(3) β€” part of the XCB Requests crew, living in libxcb. this is the one where you ask the X server "hey queen, what are the metrics on this font?" and she tells you everything. pull up a chair 🫢


✨ NAME ✨

xcb_query_font β€” query font metrics πŸ’…


🌸 SYNOPSIS 🌸

#include <xcb/xproto.h>

πŸŽ€ Request function

xcb_query_font_cookie_t xcb_query_font(xcb_connection_t *conn,
       xcb_fontable_t font);

πŸŽ€ Reply datastructure

typedef struct xcb_query_font_reply_t {
    uint8_t        response_type;
    uint8_t        pad0;
    uint16_t       sequence;
    uint32_t       length;
    xcb_charinfo_t min_bounds;
    uint8_t        pad1[4];
    xcb_charinfo_t max_bounds;
    uint8_t        pad2[4];
    uint16_t       min_char_or_byte2;
    uint16_t       max_char_or_byte2;
    uint16_t       default_char;
    uint16_t       properties_len;
    uint8_t        draw_direction;
    uint8_t        min_byte1;
    uint8_t        max_byte1;
    uint8_t        all_chars_exist;
    int16_t        font_ascent;
    int16_t        font_descent;
    uint32_t       char_infos_len;
} xcb_query_font_reply_t;

πŸŽ€ Reply function

xcb_query_font_reply_t *xcb_query_font_reply(xcb_connection_t *conn,
       xcb_query_font_cookie_t cookie, xcb_generic_error_t **e);

πŸŽ€ Reply accessors

xcb_fontprop_t *xcb_query_font_properties(const xcb_query_font_request_t
       *reply);

int xcb_query_font_properties_length(const xcb_query_font_reply_t
       *reply);

xcb_fontprop_iterator_t xcb_query_font_properties_iterator(const
       xcb_query_font_reply_t *reply);

xcb_charinfo_t *xcb_query_font_char_infos(const xcb_query_font_request_t
       *reply);

int xcb_query_font_char_infos_length(const xcb_query_font_reply_t
       *reply);

xcb_charinfo_iterator_t xcb_query_font_char_infos_iterator(const
       xcb_query_font_reply_t *reply);

πŸ¦‹ REQUEST ARGUMENTS πŸ¦‹

  • conn β€” the XCB connection to X11, obvs. your lil hotline to the server πŸ’œ
  • font β€” the fontable (that's a Font or a Graphics Context) you wanna query. yes bestie, either one works πŸŽ€

πŸ’… REPLY FIELDS πŸ’…

  • response_type β€” the type of this reply, which in this case is XCB_QUERY_FONT. this field also lives in the xcb_generic_reply_t, so you can use it to tell your replies apart from each other. very main character of it ✨
  • sequence β€” the sequence number of the last request the X11 server processed.
  • length β€” how long the reply is, in words. and no, not vibes-words β€” a word is 4 bytes πŸ“
  • min_bounds β€” minimum bounds over all existing char.
  • max_bounds β€” maximum bounds over all existing char.
  • min_char_or_byte2 β€” first character.
  • max_char_or_byte2 β€” last character.
  • default_char β€” the char to print for an undefined character.
  • properties_len β€” how many properties there are.
  • draw_direction β€” one of the following values, bestie:
    • XCB_FONT_DRAW_LEFT_TO_RIGHT β€” TODO: NOT YET DOCUMENTED. 😭
    • XCB_FONT_DRAW_RIGHT_TO_LEFT β€” TODO: NOT YET DOCUMENTED. 😭
  • min_byte1 β€” TODO: NOT YET DOCUMENTED. πŸ’€
  • max_byte1 β€” TODO: NOT YET DOCUMENTED. πŸ’€
  • all_chars_exist β€” flag if all characters have nonzero size.
  • font_ascent β€” baseline to top edge of raster.
  • font_descent β€” baseline to bottom edge of raster.
  • char_infos_len β€” TODO: NOT YET DOCUMENTED. πŸ’€

🌈 DESCRIPTION 🌈

Queries information associated with the font. that's it, that's the whole thing. she's simple, she's iconic, she gets the job done πŸ’–


⭐ RETURN VALUE ⭐

Returns an xcb_query_font_cookie_t. Errors have to be handled when calling the reply function xcb_query_font_reply.

If you'd rather handle errors in the event loop instead, use xcb_query_font_unchecked. See xcb-requests(3) for details, bestie.


πŸ“ ERRORS πŸ“

This request does never generate any errors. no drama, no chaos, she's chill 🧚


πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.


okay that's the whole page, you ate it, you understood it, periodt πŸ’…βœ¨ this was X Version 11, libxcb 1.17.0, and yeah the whole thing is xcb_query_font(3) β€” go query some fonts bestie, ily πŸ«ΆπŸŽ€πŸŒΈ