Xlib,不同字体大小的字符串,c

Xlib, strings of different font size, c

我画了 2 个字符串,我希望第二个字符串的字体更大。这是我使用的部分代码:

XFontStruct* font;
char* name = "-*-dejavu sans-bold-r-*-*-*-220-100-100-*-*-iso8859-1";
font = XLoadQueryFont(dpy, name);
XSetFont(dpy, gc, font->fid);
XTextExtents(font, msg, len, &dir, &ascent, &descent, &overall);
XDrawString(dpy,w,gc, (width-XTextWidth(font, msg, strlen(msg)))/2, y-ascent, msg, strlen(msg));
XDrawString(dpy,w,gc, (width-XTextWidth(font, msg2, strlen(msg2)))/2, y-ascent, msg2, strlen(msg2));

我该怎么做?

这个可行(@luser droog 是对的),不确定是否有更好的方法。

XFontStruct* font;
char* name = "-*-dejavu sans-bold-r-*-*-*-220-100-100-*-*-iso8859-1";
font = XLoadQueryFont(dpy, name);
XSetFont(dpy, gc, font->fid);
XTextExtents(font, msg, len, &dir, &ascent, &descent, &overall);
XDrawString(dpy,w,gc, (width-XTextWidth(font, msg, strlen(msg)))/2, y-ascent, msg, strlen(msg));
XSetFont(dpy, gc, font2->fid);    
XDrawString(dpy,w,gc, (width-XTextWidth(font, msg2, strlen(msg2)))/2, y-ascent, msg2, strlen(msg2));