emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't display Japanese text in menu bar


From: Kenichi Handa
Subject: Re: Can't display Japanese text in menu bar
Date: Wed, 20 Dec 2006 16:19:59 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.91 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

In article <address@hidden>, Katsumi Yamaoka <address@hidden> writes:

> > Anyway, I suspect that somehow the menu widget is not
> > created with a correct fontset.  Though, I have not yet
> > investigated the problem deeper.

I found what is wrong.  In x_load_resources (xrdb.c),
default values of several X resources are set, but fontSet
is not set.  But, in x_update_menu_appearance (xfaces.c)
which is called when you set `menu' face, the fontSet
resource is set.   That's why executing
        (set-face-font 'menu (face-font 'menu))
makes the menu label display correctly.

> I hope it is fixed in Emacs 22.2 or 23. ;-)

I've just installed the attached patch for 23
(emacs-unicode-2 branch).  Could you please confirm that the
change surely fixes the problem in your environment too?

By the way, I think the relevant code should be improved to
reflect a font specified for menu bar in a created fontset,
but, for the moment, I don't have a time to work on it,
sorry.

---
Kenichi Handa
address@hidden

2006-12-20  Kenichi Handa  <address@hidden>

        * xrdb.c (x_load_resources): Setup the default fontSet X reource.

Index: xrdb.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xrdb.c,v
retrieving revision 1.48.8.8
retrieving revision 1.48.8.9
diff -u -r1.48.8.8 -r1.48.8.9
--- xrdb.c      17 Apr 2006 08:40:56 -0000      1.48.8.8
+++ xrdb.c      20 Dec 2006 07:07:13 -0000      1.48.8.9
@@ -610,6 +610,29 @@
 
 #endif /* not USE_MOTIF */
 
+#ifdef HAVE_X_I18N
+  {
+#ifdef USE_MOTIF
+    Bool motif = True;
+#else  /* not USE_MOTIF */
+    Bool motif = False;
+#endif  /* not USE_MOTIF */
+    /* Setup the default fontSet resource.  */
+    extern char *xic_create_fontsetname P_ ((char *base_fontname, Bool motif));
+    char *fontsetname = xic_create_fontsetname (helv, motif);
+    int len = strlen (fontsetname);
+    char *buf = line;
+
+    /* fontsetname may be very long.  */
+    if (len + 16 > 256)
+      buf = alloca (len + 16);
+    sprintf (buf, "Emacs*fontSet: %s", fontsetname);
+    XrmPutLineResource (&rdb, buf);
+    if (fontsetname != helv)
+      xfree (fontsetname);
+  }
+#endif /* HAVE_X_I18N */
+
   user_database = get_user_db (display);
 
   /* Figure out what the "customization string" is, so we can use it




reply via email to

[Prev in Thread] Current Thread [Next in Thread]