Unfortunately, font handling is fragmented in X11 and what you want is not possible.
The Xlib function XListFonts()
will returns the list of 'old', fixed-sized fonts like '-adobe-courier-bold-o-normal--0-0-100-100-m-iso10464-1'. And that's all the information there is; just a name and a bunch of parameters.
What you are seeking are the functions from Freetype like XftFontOpenName()
, where you can supply a pattern like "Courier New-14:bold:slant=italic,oblique". But it is a completely different way of rendering fonts and there is no connection between the two font systems.
You can query the Xft library for a list of fonts using XftFontMatch()
, perhaps that will give you the information you seek. But you will have to use the freetype library (a small price to pay, I think).