[GRASS5] tcl/tk chinese fonts issue

(cc grass5)

On Thu, Mar 17, 2005 at 04:21:24PM +0800, nilarcs wrote:

On Tue, 15 Mar 2005 09:43:46 +0100, Markus Neteler <neteler@itc.it> wrote:
> On Tue, Mar 15, 2005 at 03:27:39PM +0800, nilarcs wrote:

[ Initial chinese translation in CVS now ]

> > Today I have tested the po file, it worked fine. But the font in the
> > GUI looks ugly , I want to change the font, but I don't know how to
> > do. Can you give me some suggestion?
>
About the font, I think one picture is more clear than thousands words :slight_smile:

[example attached]

Actually I don't know how to change the font for the tcl/tk
windows. In the old 'tcltkgrass' there was an option for that
which isn't migrated yet (AFAIK).

Maybe our tcl experts have an idea.
Probably just the bold fonts are causing problems (font size?).

Is there any branch of grass with GTK2 or QT ?

There is QGIS with GRASS support, but it would be nice to have
that fixed in GRASS as well.

Zhang Jun
2005-03-17

Markus

(attachments)

grass_chinese_font.png

Glynn said how to set the font for tcltk, but I don't remember where it is.

Michael
____________________
C. Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
PO Box 872402
Arizona State University
Tempe, AZ 85287-2402
USA

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

From: Markus Neteler <neteler@itc.it>
Date: Fri, 18 Mar 2005 16:32:46 +0100
To: nilarcs <nilarcs@gmail.com>
Cc: grass5 developers list <grass5@grass.itc.it>
Subject: [GRASS5] tcl/tk chinese fonts issue

(cc grass5)

On Thu, Mar 17, 2005 at 04:21:24PM +0800, nilarcs wrote:

On Tue, 15 Mar 2005 09:43:46 +0100, Markus Neteler <neteler@itc.it> wrote:

On Tue, Mar 15, 2005 at 03:27:39PM +0800, nilarcs wrote:

[ Initial chinese translation in CVS now ]

Today I have tested the po file, it worked fine. But the font in the
GUI looks ugly , I want to change the font, but I don't know how to
do. Can you give me some suggestion?

About the font, I think one picture is more clear than thousands words :slight_smile:

[example attached]

Actually I don't know how to change the font for the tcl/tk
windows. In the old 'tcltkgrass' there was an option for that
which isn't migrated yet (AFAIK).

Maybe our tcl experts have an idea.
Probably just the bold fonts are causing problems (font size?).

Is there any branch of grass with GTK2 or QT ?

There is QGIS with GRASS support, but it would be nice to have
that fixed in GRASS as well.

Zhang Jun
2005-03-17

Markus

Markus Neteler wrote:

> > > Today I have tested the po file, it worked fine. But the font in the
> > > GUI looks ugly , I want to change the font, but I don't know how to
> > > do. Can you give me some suggestion?
> >
> About the font, I think one picture is more clear than thousands words :slight_smile:

[example attached]

Actually I don't know how to change the font for the tcl/tk
windows.

You can change it through X resources.

However Tcl's handling of X resources is rather broken; in particular,
program-specific settings don't work if the program name contains any
dots (as is the case for d.m.tcl).

You can override the name using the -name switch e.g.:

   exec "$GRASS_WISH" "$GISBASE/etc/dm/d.m.tcl" -name d_m_tcl

[I suggest making the above change to the d.m script, in both places.]

You can then set a font resource in ~/.Xdefaults with e.g.:

  d_m_tcl*font: -adobe-helvetica-bold-r-*-*-16-*-*-*-*-*-iso8859-1

Also, it chooses the last matching key (not the most specific match),
so you have to place the above setting after any generic font
setting.

--
Glynn Clements <glynn@gclements.plus.com>

Yeah , it's great!
Thank you very much!
I think you should add this to the FAQ , someone else maybe need this too :slight_smile:
(BTW:Don't forget "xrdb -merge .Xdefaults" after you change the
.Xdefaults file.)

Zhang Jun
2005-3-21

On Fri, 18 Mar 2005 21:03:55 +0000, Glynn Clements
<glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

> > > > Today I have tested the po file, it worked fine. But the font in the
> > > > GUI looks ugly , I want to change the font, but I don't know how to
> > > > do. Can you give me some suggestion?
> > >
> > About the font, I think one picture is more clear than thousands words :slight_smile:
>
> [example attached]
>
> Actually I don't know how to change the font for the tcl/tk
> windows.

You can change it through X resources.

However Tcl's handling of X resources is rather broken; in particular,
program-specific settings don't work if the program name contains any
dots (as is the case for d.m.tcl).

You can override the name using the -name switch e.g.:

   exec "$GRASS_WISH" "$GISBASE/etc/dm/d.m.tcl" -name d_m_tcl

[I suggest making the above change to the d.m script, in both places.]
You can then set a font resource in ~/.Xdefaults with e.g.:

        d_m_tcl*font: -adobe-helvetica-bold-r-*-*-16-*-*-*-*-*-iso8859-1

Also, it chooses the last matching key (not the most specific match),
so you have to place the above setting after any generic font
setting.

--
Glynn Clements <glynn@gclements.plus.com>

nilarcs wrote:

(BTW:Don't forget "xrdb -merge .Xdefaults" after you change the
.Xdefaults file.)

Technically, "xrdb -merge ~/.Xdefaults" is wrong. Unfortunately,
certain broken configurations (most notably KDE) require it.

To check whether you need to do it, run "xrdb -query". If it produces
any output, they you need to use "xrdb -merge ..." to update it; if it
produces no output, you don't.

Xt-based applications obtain resources from either:

a) the RESOURCE_MANAGER and SCREEN_RESOURCES properties on the root
window(s), or:

b) the ~/.Xdefaults file, if the aforementioned properties don't
exist.

The xrdb program sets and queries the resources described in a). If
you never use xrdb, applications read ~/.Xdefaults directly.

If you are running X applications on multiple hosts, it matters which
approach you use. If you use a), all applications will use the
resources from the root window properties; if you use b), each
application will use the local ~/.Xdefaults file.

For full details on how X resources are configured, see question 20 in
the comp.windows.x.intrinsics FAQ:

  http://www.faqs.org/faqs/Xt-FAQ/section-21.html

However, Tk ignores most of what is described there. It provides a
minimal emulation which will typically pick up your global font,
background and foreground settings but ignore the rest.

--
Glynn Clements <glynn@gclements.plus.com>