diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -607,6 +607,7 @@ FindFontSet(MyFont *font, const char *fontname) twmVerbose("font for charset %s is lacking.", missing_charset_list_return[i]); } + XFreeStringList(missing_charset_list_return); } font_extents = XExtentsOfFontSet(font->fontset); @@ -672,6 +673,24 @@ GetFont(MyFont *font) } } +void +DestroyFont(MyFont *font) +{ + if (!font) { + return; + } + + if (font->fontset) { + XFreeFontSet(dpy, font->fontset); + font->fontset = NULL; + } + + if (font->font) { + XFreeFont(dpy, font->font); + font->font = NULL; + } +} + int MyFont_TextWidth(MyFont *font, const char *string, int len) { |