Patch for Emacs-21 using FontList for menubar.

Set X resource. For example, add following in ~/.Xdefaults.
Emacs*menubar*fontset: -misc-fixed-medium-r-normal--14-130-*

Original patch (emacs-20.4-fontset-19990915.diff) is coded by Daiki Ueno.

-- 
Akihiro Arisawa <ari@nijino.com>

diff -ur emacs-21.1.orig/lwlib/xlwmenu.c emacs-21.1/lwlib/xlwmenu.c
--- emacs-21.1.orig/lwlib/xlwmenu.c	Mon Apr 30 23:34:54 2001
+++ emacs-21.1/lwlib/xlwmenu.c	Wed Oct 24 23:06:38 2001
@@ -78,6 +78,9 @@
 static XEvent menu_post_event;
 
 XFontStruct *xlwmenu_default_font;
+#ifdef USE_XFONTSET
+XFontSet xlwmenu_default_fontset;
+#endif
 
 static char
 xlwMenuTranslations [] =
@@ -122,6 +125,10 @@
 {
   {XtNfont,  XtCFont, XtRFontStruct, sizeof(XFontStruct *),
      offset(menu.font),XtRString, "XtDefaultFont"},
+#ifdef USE_XFONTSET
+  {XtNfontSet,  XtCFontSet, XtRFontSet, sizeof(XFontSet),
+     offset(menu.font_set), XtRString, (XtPointer) "XtDefaultFontSet"},
+#endif
   {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
      offset(menu.foreground), XtRString, "XtDefaultForeground"},
   {XtNbuttonForeground, XtCButtonForeground, XtRPixel, sizeof(Pixel),
@@ -311,18 +318,24 @@
      XlwMenuWidget mw;
      char *s;
 {
+#ifdef USE_XFONTSET
+  XRectangle ri, rl;
+  XmbTextExtents (mw->menu.font_set, s, strlen (s), &ri, &rl);
+  return rl.width;
+#else 
   XCharStruct xcs;
   int drop;
 
   XTextExtents (mw->menu.font, s, strlen (s), &drop, &drop, &drop, &xcs);
   return xcs.width;
+#endif
 }
 
 static int
 arrow_width (mw)
      XlwMenuWidget mw;
 {
-  return (mw->menu.font->ascent * 3/4) | 1;
+  return (mw->menu.font_ascent * 3/4) | 1;
 }
 
 /* Return the width of toggle buttons of widget MW.  */
@@ -331,7 +344,7 @@
 toggle_button_width (mw)
      XlwMenuWidget mw;
 {
-  return ((mw->menu.font->ascent + mw->menu.font->descent) * 2 / 3) | 1;
+  return ((mw->menu.font_ascent + mw->menu.font_descent) * 2 / 3) | 1;
 }
 
 
@@ -413,7 +426,7 @@
   else
     {
       *height =
-	mw->menu.font->ascent + mw->menu.font->descent
+	mw->menu.font_ascent + mw->menu.font_descent
 	  + 2 * mw->menu.vertical_spacing + 2 * mw->menu.shadow_thickness;
 
       *label_width =
@@ -529,7 +542,7 @@
   double factor = 1.62;
   int thickness2 = thickness * factor;
 
-  y += (mw->menu.font->ascent + mw->menu.font->descent - height) / 2;
+  y += (mw->menu.font_ascent + mw->menu.font_descent - height) / 2;
 
   if (down_p)
     {
@@ -715,7 +728,7 @@
   width = toggle_button_width (mw);
   height = width;
   x += mw->menu.horizontal_spacing;
-  y += (mw->menu.font->ascent - height) / 2;
+  y += (mw->menu.font_ascent - height) / 2;
   draw_shadow_rectangle (mw, window, x, y, width, height, False, selected_p);
 }
 
@@ -735,7 +748,7 @@
   width = radio_button_width (mw);
   height = width;
   x += mw->menu.horizontal_spacing;
-  y += (mw->menu.font->ascent - height) / 2;
+  y += (mw->menu.font_ascent - height) / 2;
   draw_shadow_rhombus (mw, window, x, y, width, height, False, selected_p);
 }
 
@@ -912,8 +925,6 @@
 {
   GC deco_gc;
   GC text_gc;
-  int font_ascent = mw->menu.font->ascent;
-  int font_descent = mw->menu.font->descent;
   int shadow = mw->menu.shadow_thickness;
   int margin = mw->menu.margin;
   int h_spacing = mw->menu.horizontal_spacing;
@@ -986,9 +997,16 @@
 	    x_offset += ws->button_width;
 
 
+#ifdef USE_XFONTSET
+          XmbDrawString (XtDisplay (mw), ws->window, mw->menu.font_set,
+			 text_gc, x_offset,
+			 y + v_spacing + shadow + mw->menu.font_ascent,
+			 display_string, strlen (display_string));
+#else
           XDrawString (XtDisplay (mw), ws->window, text_gc, x_offset,
-		       y + v_spacing + shadow + font_ascent,
+		       y + v_spacing + shadow + mw->menu.font_ascent,
 		       display_string, strlen (display_string));
+#endif
 
 	  if (!horizontal_p)
 	    {
@@ -1011,10 +1029,19 @@
 		}
 	      else if (val->key)
 		{
+#ifdef USE_XFONTSET
+		  XmbDrawString (XtDisplay (mw), ws->window, 
+				 mw->menu.font_set, 
+				 text_gc,
+				 x + label_width + mw->menu.arrow_spacing,
+				 y + v_spacing + shadow + mw->menu.font_ascent,
+				 val->key, strlen (val->key));
+#else
 		  XDrawString (XtDisplay (mw), ws->window, text_gc,
 			       x + label_width + mw->menu.arrow_spacing,
-			       y + v_spacing + shadow + font_ascent,
+			       y + v_spacing + shadow + mw->menu.font_ascent,
 			       val->key, strlen (val->key));
+#endif
 		}
 	    }
 	  else
@@ -1023,7 +1050,8 @@
 			      mw->menu.background_gc,
 			      x + shadow, y + shadow,
 			      label_width + h_spacing - 1,
-			      font_ascent + font_descent + 2 * v_spacing - 1);
+			      mw->menu.font_ascent + mw->menu.font_descent
+			      + 2 * v_spacing - 1);
 	      draw_shadow_rectangle (mw, ws->window, x, y, width, height,
 				     True, False);
 	    }
@@ -1417,43 +1445,68 @@
 {
   XGCValues xgcv;
 
+#ifndef USE_XFONTSET
   xgcv.font = mw->menu.font->fid;
+#endif
   xgcv.foreground = mw->menu.foreground;
   xgcv.background = mw->core.background_pixel;
   mw->menu.foreground_gc = XtGetGC ((Widget)mw,
-				    GCFont | GCForeground | GCBackground,
+#ifndef USE_XFONTSET
+				    GCFont | 
+#endif
+				    GCForeground | GCBackground,
 				    &xgcv);
 
+#ifndef USE_XFONTSET
   xgcv.font = mw->menu.font->fid;
+#endif
   xgcv.foreground = mw->menu.button_foreground;
   xgcv.background = mw->core.background_pixel;
   mw->menu.button_gc = XtGetGC ((Widget)mw,
-				GCFont | GCForeground | GCBackground,
+#ifndef USE_XFONTSET
+				GCFont | 
+#endif
+				GCForeground | GCBackground,
 				&xgcv);
 
+#ifndef USE_XFONTSET
   xgcv.font = mw->menu.font->fid;
+#endif
   xgcv.foreground = mw->menu.foreground;
   xgcv.background = mw->core.background_pixel;
   xgcv.fill_style = FillStippled;
   xgcv.stipple = mw->menu.gray_pixmap;
   mw->menu.inactive_gc = XtGetGC ((Widget)mw,
-				  (GCFont | GCForeground | GCBackground
-				   | GCFillStyle | GCStipple), &xgcv);
+#ifndef USE_XFONTSET
+				  GCFont | 
+#endif
+				  GCForeground | GCBackground
+				  | GCFillStyle | GCStipple, &xgcv);
 
+#ifndef USE_XFONTSET
   xgcv.font = mw->menu.font->fid;
+#endif
   xgcv.foreground = mw->menu.button_foreground;
   xgcv.background = mw->core.background_pixel;
   xgcv.fill_style = FillStippled;
   xgcv.stipple = mw->menu.gray_pixmap;
   mw->menu.inactive_button_gc = XtGetGC ((Widget)mw,
-				  (GCFont | GCForeground | GCBackground
-				   | GCFillStyle | GCStipple), &xgcv);
+#ifndef USE_XFONTSET
+					 GCFont | 
+#endif
+					 GCForeground | GCBackground
+					 | GCFillStyle | GCStipple, &xgcv);
 
+#ifndef USE_XFONTSET
   xgcv.font = mw->menu.font->fid;
+#endif
   xgcv.foreground = mw->core.background_pixel;
   xgcv.background = mw->menu.foreground;
   mw->menu.background_gc = XtGetGC ((Widget)mw,
-				    GCFont | GCForeground | GCBackground,
+#ifndef USE_XFONTSET
+				    GCFont | 
+#endif
+				    GCForeground | GCBackground,
 				    &xgcv);
 }
 
@@ -1632,6 +1685,30 @@
 }
 
 static void
+extract_font_extents (XlwMenuWidget mw)
+{
+#ifdef USE_XFONTSET
+  XFontStruct **fontstruct_list;
+  char **fontname_list;
+  XFontStruct *font;
+  int fontcount = XFontsOfFontSet(mw->menu.font_set, &fontstruct_list,
+                                      &fontname_list);
+  mw->menu.font_ascent  = 0;
+  mw->menu.font_descent = 0;
+  while (--fontcount >= 0) {
+      font = fontstruct_list[fontcount];
+      if (font->ascent > (int) mw->menu.font_ascent)
+          mw->menu.font_ascent = font->ascent;
+      if (font->descent > (int) mw->menu.font_descent)
+          mw->menu.font_descent = font->descent;
+  }
+#else /* ! USE_XFONTSET */
+  mw->menu.font_ascent  = mw->menu.font->ascent;
+  mw->menu.font_descent = mw->menu.font->descent;
+#endif
+}
+
+static void
 XlwMenuInitialize (request, mw, args, num_args)
      Widget request;
      XlwMenuWidget mw;
@@ -1670,6 +1747,7 @@
 
   make_drawing_gcs (mw);
   make_shadow_gcs (mw);
+  extract_font_extents (mw);
 
   xswa.background_pixel = mw->core.background_pixel;
   xswa.border_pixel = mw->core.border_pixel;
diff -ur emacs-21.1.orig/lwlib/xlwmenuP.h emacs-21.1/lwlib/xlwmenuP.h
--- emacs-21.1.orig/lwlib/xlwmenuP.h	Sat Jun 17 03:33:58 2000
+++ emacs-21.1/lwlib/xlwmenuP.h	Wed Oct 24 22:54:51 2001
@@ -3,6 +3,7 @@
 
 #include "xlwmenu.h"
 #include <X11/CoreP.h>
+#define USE_XFONTSET 1
 
 /* Elements in the stack arrays. */
 typedef struct _window_state
@@ -24,6 +25,11 @@
 {
   /* slots set by the resources */
   XFontStruct*	font;
+#ifdef USE_XFONTSET
+  XFontSet font_set;
+#endif
+  Dimension	font_ascent, font_descent;  /* extracted from font/fontlist */
+
   Pixel		foreground;
   Pixel		button_foreground;
   Dimension	margin;
