summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael van Elst <mlelstv@NetBSD.org>2015-07-19 12:04:52 +0200
committerThomas Klausner <wiz@NetBSD.org>2015-07-19 23:03:05 +0200
commitc644db2c3a1b6c9e5e99da130493a978a7d08010 (patch)
tree8304d98c986a022eff3df5faf03ca991489d9e8e /src
parentb52e4041054b580bace70d9db5e7e3d90b33ad6d (diff)
Do not try to extend the font-pattern with a wild-card.
This will almost always select the wrong fontset and use wrong metrics. Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src')
-rw-r--r--src/util.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/util.c b/src/util.c
index 9e5675a..4b94051 100644
--- a/src/util.c
+++ b/src/util.c
@@ -589,17 +589,13 @@ GetFont(MyFont *font)
int ascent;
int descent;
int fnum;
- char *basename2;
if (use_fontset) {
if (font->fontset != NULL){
XFreeFontSet(dpy, font->fontset);
}
- basename2 = malloc(strlen(font->name) + 3);
- if (basename2) sprintf(basename2, "%s,*", font->name);
- else basename2 = font->name;
- if( (font->fontset = XCreateFontSet(dpy, basename2,
+ if( (font->fontset = XCreateFontSet(dpy, font->name,
&missing_charset_list_return,
&missing_charset_count_return,
&def_string_return)) == NULL) {
@@ -607,7 +603,6 @@ GetFont(MyFont *font)
ProgramName, font->name);
exit(1);
}
- if (basename2 != font->name) free(basename2);
for(i=0; i<missing_charset_count_return; i++){
printf("%s: warning: font for charset %s is lacking.\n",
ProgramName, missing_charset_list_return[i]);