Re: Can't display Japanese text in menu bar

2006-12-20 Thread Katsumi Yamaoka
I'm sorry for the late response.

> In <[EMAIL PROTECTED]> Kenichi Handa wrote:

> 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?

I confirmed the change did the trick.  I ran Emacs 23 with the
-Q option and viewed the Japanese menu by evaluating the code
that I posted first.  Thank you.

Although the X resources seems to be ignored now, I believe all
will be fixed in the future.

> 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.

Most of Japanese are busy at the year-end, so please do your own
business. ;-)

Regards,


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Can't display Japanese text in menu bar

2006-12-19 Thread Kenichi Handa
In article <[EMAIL PROTECTED]>, Katsumi Yamaoka <[EMAIL PROTECTED]> 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
[EMAIL PROTECTED]

2006-12-20  Kenichi Handa  <[EMAIL PROTECTED]>

* 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 -  1.48.8.8
+++ xrdb.c  20 Dec 2006 07:07:13 -  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


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Can't display Japanese text in menu bar

2006-12-19 Thread Katsumi Yamaoka
> In <[EMAIL PROTECTED]> Katsumi Yamaoka wrote:

> (let ((japanese (decode-coding-string "\e$B%F%9%H\e(B" 'iso-2022-jp)))
>   (easy-menu-define testing-menu global-map "Testing."
> `("Testing"
>   [,japanese (lambda nil (interactive) (message ,japanese)) t]))
>   (easy-menu-add testing-menu global-map))

> In <[EMAIL PROTECTED]> Kenichi Handa wrote:

> I found a way to reproduce this problem.  I have this X
> resource:

> *fontSet: -*-*-medium-r-normal--16-*-*-*

(I had removed all the X resources for Emacs because I wanted to
have a real vanilla Emacs, which can be launched by only the -q
option.  I will configure it in the ~/.emacs file even if I need
to use customized ones.  Although I have only two fontsets since
I don't know how to do it, I don't feel inconvenience with them.)

> When I remove the resource and run Emacs, I see incorrect
> menu label, and

 (set-face-font 'menu (face-font 'menu))

> surely make the label displayed correctly.

Thank you for verifying it.

> And, starting emacs with:

> % emacs -xrm '*fontSet: -*-*-medium-r-normal--16-*-*-*'

> also displays the menu label correctly.  Please try it by
> yourself.

I confirmed it makes Emacs display Japanese menu.

> 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 hope it is fixed in Emacs 22.2 or 23. ;-)

Regards,


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Can't display Japanese text in menu bar

2006-12-18 Thread Kenichi Handa
In article <[EMAIL PROTECTED]>, Katsumi Yamaoka <[EMAIL PROTECTED]> writes:

> [1  ]
> First of all, this issue is not necessarily serious at least for
> me and Nomiya-san since we have a workaround to solve it.  So,
> you can let us wait.  I have doubts that it doesn't work for us
> even if it works for Handa-san, though.

>> In <[EMAIL PROTECTED]> Katsumi Yamaoka wrote:
>>> In <[EMAIL PROTECTED]> Handa-san wrote:

 (let ((japanese (decode-coding-string "\e$B%F%9%H\e(B" 'iso-2022-jp)))
 (easy-menu-define testing-menu global-map "Testing."
 `("Testing"
 [,japanese (lambda nil (interactive) (message ,japanese)) t]))
 (easy-menu-add testing-menu global-map))

>>> It works for me (my Emacs also uses LUCID) both in
>>> ja_JP.EUC-JP and en_US.UTF-8.  In which locale did you test
>>> it?

I found a way to reproduce this problem.  I have this X
resource:

*fontSet: -*-*-medium-r-normal--16-*-*-*

When I remove the resource and run Emacs, I see incorrect
menu label, and

>>> (set-face-font 'menu (face-font 'menu))

surely make the label displayed correctly.

And, starting emacs with:

% emacs -xrm '*fontSet: -*-*-medium-r-normal--16-*-*-*'

also displays the menu label correctly.  Please try it by
yourself.

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

---
Kenichi Handa
[EMAIL PROTECTED]




___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Can't display Japanese text in menu bar

2006-12-14 Thread Katsumi Yamaoka
First of all, this issue is not necessarily serious at least for
me and Nomiya-san since we have a workaround to solve it.  So,
you can let us wait.  I have doubts that it doesn't work for us
even if it works for Handa-san, though.

> In <[EMAIL PROTECTED]> Katsumi Yamaoka wrote:
>> In <[EMAIL PROTECTED]> Handa-san wrote:

>>> (let ((japanese (decode-coding-string "\e$B%F%9%H\e(B" 'iso-2022-jp)))
>>>   (easy-menu-define testing-menu global-map "Testing."
>>> `("Testing"
>>>   [,japanese (lambda nil (interactive) (message ,japanese)) t]))
>>>   (easy-menu-add testing-menu global-map))

>> It works for me (my Emacs also uses LUCID) both in
>> ja_JP.EUC-JP and en_US.UTF-8.  In which locale did you test
>> it?

> The locale command returns the following in the PCs, running
> Fedora Core 6 Linux, both in the office and home.

> LANG=ja_JP.eucjp
> LC_CTYPE=ja_JP.eucjp

[...]

> Those are set globally in the systems and I don't modify any of
> them in Emacs.  I verified it doesn't work in both the PCs.

The menu bar doesn't display Japanese text but displays the one
looking like raw encoded data as shown in the attached image1
below.  I also tried it with latest Emacs CVS in the Solaris 2.6
machine.  But there was no difference.

Although it might be irrelevant to this issue, I found a funny
thing in relation to the `menu' face.

>>> I found the way to make it work.  That is to re-set the font for
>>> the `menu' face as follows:

>>> (set-face-font 'menu (face-font 'menu))

It works, however it changes the font used in the menu bar.  In
other words, the font that the form (face-font 'menu) returns is
not the font being actually used.  Please compare image1 and 2.
Furthermore, I tried an X resource for setting the font for the
menu face as follows:

*menubar*Font: -*-helvetica-bold-o-normal--14-*-iso8859-1

It works and Emacs uses the oblique font in the menu bar.
However, (face-font 'menu) seems to always return

"-Adobe-Courier-Medium-R-Normal--12-120-75-75-M-70-ISO8859-1"

if the form (set-face-font 'menu "foo") has never been performed.



Regards,
___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Can't display Japanese text in menu bar

2006-12-12 Thread Katsumi Yamaoka
Thanks Handa-san for following up.

> In <[EMAIL PROTECTED]> Handa-san wrote:

>> (let ((japanese (decode-coding-string "\e$B%F%9%H\e(B" 'iso-2022-jp)))
>>   (easy-menu-define testing-menu global-map "Testing."
>> `("Testing"
>>   [,japanese (lambda nil (interactive) (message ,japanese)) t]))
>>   (easy-menu-add testing-menu global-map))

> It works for me (my Emacs also uses LUCID) both in
> ja_JP.EUC-JP and en_US.UTF-8.  In which locale did you test
> it?

The locale command returns the following in the PCs, running
Fedora Core 6 Linux, both in the office and home.

LANG=ja_JP.eucjp
LC_CTYPE=ja_JP.eucjp
LC_NUMERIC=C
LC_TIME=C
LC_COLLATE=C
LC_MONETARY=C
LC_MESSAGES=C
LC_PAPER=C
LC_NAME=C
LC_ADDRESS=C
LC_TELEPHONE=C
LC_MEASUREMENT=C
LC_IDENTIFICATION=C
LC_ALL=

Those are set globally in the systems and I don't modify any of
them in Emacs.  I verified it doesn't work in both the PCs.

>> I found the way to make it work.  That is to re-set the font for
>> the `menu' face as follows:

>> (set-face-font 'menu (face-font 'menu))

>> But I don't think this is the right way.  WDYT?

> I have no idea why it makes any change.

I'll look into it further...


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: Can't display Japanese text in menu bar

2006-12-12 Thread Kenichi Handa
In article <[EMAIL PROTECTED]>, Katsumi Yamaoka <[EMAIL PROTECTED]> writes:

> I noticed that Japanese text cannot be displayed in the menu bar.
> I use the LUCID menu bar, not the GTK version, and I don't have
> X resources.  You will be able to reproduce this by starting
> Emacs with the -Q option and evaluating the following form:

> (let ((japanese (decode-coding-string "\e$B%F%9%H\e(B" 'iso-2022-jp)))
>   (easy-menu-define testing-menu global-map "Testing."
> `("Testing"
>   [,japanese (lambda nil (interactive) (message ,japanese)) t]))
>   (easy-menu-add testing-menu global-map))

It works for me (my Emacs also uses LUCID) both in
ja_JP.EUC-JP and en_US.UTF-8.  In which locale did you test
it?

> I found the way to make it work.  That is to re-set the font for
> the `menu' face as follows:

> (set-face-font 'menu (face-font 'menu))

> But I don't think this is the right way.  WDYT?

I have no idea why it makes any change.

---
Kenichi Handa
[EMAIL PROTECTED]


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Can't display Japanese text in menu bar

2006-12-11 Thread Katsumi Yamaoka
Hi,

I noticed that Japanese text cannot be displayed in the menu bar.
I use the LUCID menu bar, not the GTK version, and I don't have
X resources.  You will be able to reproduce this by starting
Emacs with the -Q option and evaluating the following form:

(let ((japanese (decode-coding-string "\e$B%F%9%H\e(B" 'iso-2022-jp)))
  (easy-menu-define testing-menu global-map "Testing."
`("Testing"
  [,japanese (lambda nil (interactive) (message ,japanese)) t]))
  (easy-menu-add testing-menu global-map))

I found the way to make it work.  That is to re-set the font for
the `menu' face as follows:

(set-face-font 'menu (face-font 'menu))

But I don't think this is the right way.  WDYT?

Regards,


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug