[Xcb] Question about xcb_list_fonts_with_info

Jochen Keil jochen.keil at gmail.com
Sun Dec 29 12:10:06 PST 2013


I have a question regarding the `xcb_list_fonts_with_info` request function.

The Xlib function `XListFontsWithInfo` returns an char ** array which I
can walk through by taking `count_return` into consideration.
When I try it out with e.g. maxnames = 8 and pattern = "*" I get a list
with 8 null-terminated (\0) strings of fonts available on my system,
starting with the very first.

How would I do that using the `xcb_list_fonts_with_info` function?
I can get the very first match with `xcb_list_fonts_with_info_name` and
`xcb_list_fonts_with_info_name_length`, but how would I go about for the

I tried forwarding the pointer returned by
`xcb_list_fonts_with_info_name` with
while (*font != '\0') { ++font; } ++font;

This does not work. There is only garbage after the first font string.
However, I'm not sure if it's the xcb_fontprop_t struct or just random,
unallocated memory.

Is there a way to get all of the font strings? I think this should
probably be a variable field and not a fixed one, together with a
xcb_str_iterator, like for xcb_list_fonts.

Thank you and best wishes,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20131229/0cf3cb77/attachment.pgp>

More information about the Xcb mailing list