From: YAMAMOTO Mitsuharu Date: Sun, 21 Apr 2019 02:39:06 +0000 (+0900) Subject: Fix text metrics calculation in Xft support for lwlib X-Git-Tag: emacs-27.0.90~3169 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=21db386ac0df26f0b1a549e0bd4f83c5bbce6361;p=emacs.git 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. --- diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c index 8e3a07f202f..9655076da9d 100644 --- a/lwlib/lwlib-Xaw.c +++ b/lwlib/lwlib-Xaw.c @@ -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; diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index 07ad29e1072..a5704cbfb53 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c @@ -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