There is a similar code in the Xlib backend. The logic here is the same, but XCB doesn't support X resources directly, so there is some custom code to get and parse the resources from the root window.
e691d24 xcb: Initialize font options from Xft resources
src/Makefile.sources | 1 +
src/cairo-xcb-private.h | 19 +++
src/cairo-xcb-resources.c | 304 +++++++++++++++++++++++++++++++++++++++++++++
src/cairo-xcb-screen.c | 108 ++++++++++++++++
src/cairo-xcb-surface.c | 6 +-
5 files changed, 435 insertions(+), 3 deletions(-)
Upstream: cgit.freedesktop.org