emacs-devel
[Top][All Lists]
Advanced

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

Re: Non-ASCII in Lucid menus


From: Jan D.
Subject: Re: Non-ASCII in Lucid menus
Date: Mon, 14 Mar 2005 21:56:35 +0100


Basically you have to set the default to something else than the
XtDdefaultFont(Set), and then check if either has been changed.

But the default is specified as a string (the name of the default font),
whereas in the code I only have access to mw->menu.font which is
an XFontStruct*. How can I tell if this XFontStruct* corresponds to the
default or not?

You can specify any default you wan't, including another type. So you can say that the default is a XtRFontStruct intead of a XtRString. Then you can set the default to NULL and check against that. When the code sees NULL, you extract the default font with XtConvert by giving it "XtDefaultFont"/"XtDefaultFontSet".


But better would be to just have one, as Motif has FontList.

You mean I could just use ".font" instead of ".fontSet", ... Hmm ... that's
an idea.  I'll have to change the rest of the code that uses
font->max_bounds.asent and things like that, tho.

BTW, is the HAVE_X_I18N test still necessary? It'd help if we could just
assume that X_I18N is available.

I'm not sure. It is possible some older VMS or other systems still have X11R3 or X11R4 (not exactly sure when I18N became available). X11R5 and X11R6 do have it, which probably accounts for the majority of system nowdays (for example all versions of XFree86 and xorg, and Solaris back to 2.5 at least).


Also, the default font used for lucid menus will most certainly be
different now.
Why?  What can I do about it?
It is just that the default for font and fontset in Xt differs.

How?  It seems to be helvetica in both cases.

It depends on your font path. XtDefaultFont, if no font is specified in .Xdefaults or any app-defaults file, is:
    f = XLoadFont(display, "-*-*-*-R-*-*-*-120-*-*-*-*-ISO8859-*");
but XtDefaultFontSet is
    f = XCreateFontSet(display, "-*-*-*-R-*-*-*-120-*-*-*-*,*",

(note no ISO8859 in the latter case). For me that gives different matches, for you it may give the same font. Since more locales specify UTF-8 nowdays I think a difference will not be uncommon.

        Jan D.





reply via email to

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