Commit 21db386a authored by YAMAMOTO Mitsuharu's avatar YAMAMOTO Mitsuharu

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.
parent 6a373e47
Pipeline #1382 passed with stage
in 52 minutes and 2 seconds
...@@ -154,7 +154,7 @@ get_text_width_and_height (Widget widget, char *text, ...@@ -154,7 +154,7 @@ get_text_width_and_height (Widget widget, char *text,
&gi); &gi);
bp = cp ? cp + 1 : NULL; bp = cp ? cp + 1 : NULL;
h += xft_font->height; h += xft_font->height;
if (w < gi.width) w = gi.width; if (w < gi.xOff) w = gi.xOff;
} }
*height = h; *height = h;
......
...@@ -332,7 +332,7 @@ string_width (XlwMenuWidget mw, char *s) ...@@ -332,7 +332,7 @@ string_width (XlwMenuWidget mw, char *s)
XftTextExtentsUtf8 (XtDisplay (mw), mw->menu.xft_font, XftTextExtentsUtf8 (XtDisplay (mw), mw->menu.xft_font,
(FcChar8 *) s, (FcChar8 *) s,
strlen (s), &gi); strlen (s), &gi);
return gi.width; return gi.xOff;
} }
#endif #endif
#ifdef HAVE_X_I18N #ifdef HAVE_X_I18N
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment