Define wrapper for Label widgets
Renders to a Pixmap and then sets the Pixmap. This in itself does not change the appearance, but provides a means to do percentage bars, italics and more.
This commit is contained in:
committed by
Pasi Kallinen
parent
f7bb4eaae8
commit
6043d189e1
@@ -3005,6 +3005,27 @@ X11_glyph_char(const glyph_info *glyphinfo)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Given an XFontStruct, return a corresponding bold font */
|
||||
XFontStruct *
|
||||
X11_bold_font(Display *display, XFontStruct *font)
|
||||
{
|
||||
Atom font_atom;
|
||||
if (!XGetFontProperty(font, XA_FONT, &font_atom)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *font_name = XGetAtomName(display, font_atom);
|
||||
if (font_name == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *bold_font = fontname_boldify(font_name);
|
||||
XFontStruct *font2 = XLoadQueryFont(display, bold_font);
|
||||
free(bold_font);
|
||||
|
||||
return font2;
|
||||
}
|
||||
|
||||
/* Given an XFontStruct, return a corresponding italic font */
|
||||
XFontStruct *
|
||||
X11_italic_font(Display *display, XFontStruct *font)
|
||||
|
||||
Reference in New Issue
Block a user