Fix text metrics calculation in Xft support for lwlib

* lwlib/lwlib-Xaw.c (get_text_width_and_height) [HAVE_XFT]:
* lwlib/xlwmenu.c (string_width) [HAVE_XFT]: Use xOff member instead of width.
This commit is contained in:
YAMAMOTO Mitsuharu
2019-04-21 11:39:06 +09:00
parent 6a373e4742
commit 21db386ac0
2 changed files with 2 additions and 2 deletions

View File

@@ -154,7 +154,7 @@ get_text_width_and_height (Widget widget, char *text,
&gi);
bp = cp ? cp + 1 : NULL;
h += xft_font->height;
if (w < gi.width) w = gi.width;
if (w < gi.xOff) w = gi.xOff;
}
*height = h;

View File

@@ -332,7 +332,7 @@ string_width (XlwMenuWidget mw, char *s)
XftTextExtentsUtf8 (XtDisplay (mw), mw->menu.xft_font,
(FcChar8 *) s,
strlen (s), &gi);
return gi.width;
return gi.xOff;
}
#endif
#ifdef HAVE_X_I18N