SHA256
1
0
forked from pool/xemacs
xemacs/menus-always-utf8.patch

87 lines
3.1 KiB
Diff
Raw Normal View History

Index: xemacs-21.5.31/lwlib/xlwmenu.c
===================================================================
--- xemacs-21.5.31.orig/lwlib/xlwmenu.c
+++ xemacs-21.5.31/lwlib/xlwmenu.c
@@ -343,12 +343,12 @@ string_width (XlwMenuWidget mw,
#else
# ifdef USE_XFONTSET
XRectangle ri, rl;
- XmbTextExtents (mw->menu.font_set, s, strlen (s), &ri, &rl);
+ Xutf8TextExtents (mw->menu.font_set, s, strlen (s), &ri, &rl);
return rl.width;
# else
#ifdef HAVE_XFT_MENUBARS
XGlyphInfo glyphinfo;
- XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) s,
+ XftTextExtentsUtf8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) s,
strlen (s), &glyphinfo);
return glyphinfo.xOff;
#else
@@ -435,11 +435,11 @@ string_width_u (XlwMenuWidget mw,
return width;
#else
# ifdef USE_XFONTSET
- XmbTextExtents (mw->menu.font_set, newchars, j, &ri, &rl);
+ Xutf8TextExtents (mw->menu.font_set, newchars, j, &ri, &rl);
return rl.width;
# else /* ! USE_XFONTSET */
#ifdef HAVE_XFT_MENUBARS
- XftTextExtents8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) newchars,
+ XftTextExtentsUtf8 (XtDisplay (mw), mw->menu.renderFont, (FcChar8 *) newchars,
j, &glyphinfo);
return glyphinfo.xOff;
#else
@@ -769,7 +769,7 @@ x_xft_text_width (Display *dpy, XftFont
{
static XGlyphInfo glyphinfo;
- XftTextExtents8 (dpy,
+ XftTextExtentsUtf8 (dpy,
xft_font,
(FcChar8 *) run, len, &glyphinfo);
return glyphinfo.xOff;
@@ -816,12 +816,12 @@ string_draw (XlwMenuWidget mw,
x_xft_text_width (display, renderFont, string, strlen (string)),
renderFont->ascent + renderFont->descent); /* XXX */
/* draw text */
- XftDrawString8 (xftDraw, color, renderFont, x, y + mw->menu.font_ascent,
+ XftDrawStringUtf8 (xftDraw, color, renderFont, x, y + mw->menu.font_ascent,
(FcChar8 *) string, strlen (string));
XftDrawDestroy (xftDraw);
# else
# ifdef USE_XFONTSET
- XmbDrawString (XtDisplay (mw), window, mw->menu.font_set, gc,
+ Xutf8DrawString (XtDisplay (mw), window, mw->menu.font_set, gc,
x, y + mw->menu.font_ascent, string, strlen (string));
# else
XDrawString (XtDisplay (mw), window, gc,
@@ -877,10 +877,10 @@ string_draw_range (
if (end <= start)
return 0;
- XmbDrawString (
+ Xutf8DrawString (
XtDisplay (mw), window, mw->menu.font_set, gc,
x, y + mw->menu.font_ascent, &string[start], end - start);
- XmbTextExtents (
+ Xutf8TextExtents (
mw->menu.font_set, &string[start], end - start, &ri, &rl);
return rl.width;
# else
@@ -903,12 +903,12 @@ string_draw_range (
renderFont, &string[start], end - start),
renderFont->ascent + renderFont->descent); /* XXX */
/* draw text */
- XftDrawString8 (xftDraw, color, renderFont,
+ XftDrawStringUtf8 (xftDraw, color, renderFont,
x, y + mw->menu.font_ascent,
(FcChar8 *) &string[start], end - start);
- XftTextExtents8 (display, renderFont, (FcChar8 *) &string[start],
- end - start, &glyphinfo);
+ XftTextExtentsUtf8 (display, renderFont, (FcChar8 *) &string[start],
+ end - start, &glyphinfo);
/* #### should use parent frame's .xftDraw */
XftDrawDestroy (xftDraw);