]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix text metrics calculation in Xft support for lwlib
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sun, 21 Apr 2019 02:39:06 +0000 (11:39 +0900)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Sun, 21 Apr 2019 02:39:06 +0000 (11:39 +0900)
* lwlib/lwlib-Xaw.c (get_text_width_and_height) [HAVE_XFT]:
* lwlib/xlwmenu.c (string_width) [HAVE_XFT]: Use xOff member instead of width.

lwlib/lwlib-Xaw.c
lwlib/xlwmenu.c

index 8e3a07f202fd8670bc687f44510ec2be9568417a..9655076da9dc4cec4b45cb917a1bbdd2a4ddacdd 100644 (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;
index 07ad29e1072e2b30de26831ca5fa83b5631e7d42..a5704cbfb5398793c1b6dffc5c04a2b9e84c48bd 100644 (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