[GRASS-dev] default display font selection in GUI

I’ve added a menu option (under configure) to make it easier to set the default font for displayed text in GRASS. It works pretty well with my Mac, but it needs to be tested on other systems. Currently it tries to get you to a reasonable possibility for a directory containing your fonts. On the Mac, it goes to /Library/Fonts, on Windows, it starts at $WINDIR/fonts, on other systems, it starts at /usr/lib/x11/fonts. If one of these directories does not contain your fonts, you can browse to it. The font selection dialog will retain your settings throughout the GRASS session to make it easy to change default display fonts.

Michael


Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Michael Barton wrote:

I¹ve added a menu option (under configure) to make it easier to set
the default font for displayed text in GRASS. It works pretty well
with my Mac, but it needs to be tested on other systems. Currently it
tries to get you to a reasonable possibility for a directory
containing your fonts. On the Mac, it goes to /Library/Fonts, on
Windows, it starts at $WINDIR/fonts, on other systems, it starts at
/usr/lib/x11/fonts. If one of these directories does not contain your
fonts, you can browse to it. The font selection dialog will retain
your settings throughout the GRASS session to make it easy to change
default display fonts.

WRT Linux, it should be "X11", not "x11":

- /usr/lib/x11/fonts
+ /usr/lib/X11/fonts

on Debian all the TT fonts are in /usr/share/fonts [/truetype/].

/usr/lib/X11/fonts exists as a symlink to /usr/X11R6/lib/X11/fonts/,
but that only has residual symlinks, encoding info, and cache files.

Debian can/will always patch to do things the Debian way, but what's
popular with other distros these days?

Hamish

Hamish wrote:

Michael Barton wrote:

I^(1)ve added a menu option (under configure) to make it easier to set
the default font for displayed text in GRASS. It works pretty well
with my Mac, but it needs to be tested on other systems. Currently it
tries to get you to a reasonable possibility for a directory
containing your fonts. On the Mac, it goes to /Library/Fonts, on
Windows, it starts at $WINDIR/fonts, on other systems, it starts at
/usr/lib/x11/fonts. If one of these directories does not contain your
fonts, you can browse to it. The font selection dialog will retain
your settings throughout the GRASS session to make it easy to change
default display fonts.

WRT Linux, it should be "X11", not "x11":

- /usr/lib/x11/fonts
+ /usr/lib/X11/fonts

on Debian all the TT fonts are in /usr/share/fonts [/truetype/].

Same on Ubuntu 6.06.1 Dapper.

/usr/lib/X11/fonts exists as a symlink to /usr/X11R6/lib/X11/fonts/,
but that only has residual symlinks, encoding info, and cache files.

On Ubuntu Dapper there is no /usr/X11R6/lib/X11/fonts/. Seems that the
same content you describe is present in Ubuntu's /usr/share/X11/fonts.

In /usr/lib/X11/fonts there is a set of symlinks to subdirectories of
/usr/share/X11/fonts (100dpi, 75dpi, encodings, misc, Type1).

Debian can/will always patch to do things the Debian way, but what's
popular with other distros these days?

My 0,01 PLN.

Maciek

Michael Barton wrote:

I¹ve added a menu option (under configure) to make it easier to set the
default font for displayed text in GRASS. It works pretty well with my Mac,
but it needs to be tested on other systems. Currently it tries to get you to
a reasonable possibility for a directory containing your fonts. On the Mac,
it goes to /Library/Fonts, on Windows, it starts at $WINDIR/fonts, on other
systems, it starts at /usr/lib/x11/fonts.

Note that it should be "X11" with an upper-case "X".

If one of these directories does not contain your fonts, you can
browse to it.

Does it handle the case where the directory doesn't exist? Gentoo
doesn't have /usr/lib/X11/fonts; fonts normally go into subdirectories
of /usr/share/fonts.

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

Ah yes. Capitalization is important on 'other' systems.

Michael

On 4/30/07 12:45 AM, "Hamish" <hamish_nospam@yahoo.com> wrote:

Michael Barton wrote:

I¹ve added a menu option (under configure) to make it easier to set
the default font for displayed text in GRASS. It works pretty well
with my Mac, but it needs to be tested on other systems. Currently it
tries to get you to a reasonable possibility for a directory
containing your fonts. On the Mac, it goes to /Library/Fonts, on
Windows, it starts at $WINDIR/fonts, on other systems, it starts at
/usr/lib/x11/fonts. If one of these directories does not contain your
fonts, you can browse to it. The font selection dialog will retain
your settings throughout the GRASS session to make it easy to change
default display fonts.

WRT Linux, it should be "X11", not "x11":

- /usr/lib/x11/fonts
+ /usr/lib/X11/fonts

on Debian all the TT fonts are in /usr/share/fonts [/truetype/].

/usr/lib/X11/fonts exists as a symlink to /usr/X11R6/lib/X11/fonts/,
but that only has residual symlinks, encoding info, and cache files.

Debian can/will always patch to do things the Debian way, but what's
popular with other distros these days?

Hamish

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

On 4/30/07 2:02 AM, "Glynn Clements" <glynn@gclements.plus.com> wrote:

Michael Barton wrote:

I¹ve added a menu option (under configure) to make it easier to set the
default font for displayed text in GRASS. It works pretty well with my Mac,
but it needs to be tested on other systems. Currently it tries to get you to
a reasonable possibility for a directory containing your fonts. On the Mac,
it goes to /Library/Fonts, on Windows, it starts at $WINDIR/fonts, on other
systems, it starts at /usr/lib/x11/fonts.

Note that it should be "X11" with an upper-case "X".

Duly noted by Hamish.

If one of these directories does not contain your fonts, you can
browse to it.

Does it handle the case where the directory doesn't exist? Gentoo
doesn't have /usr/lib/X11/fonts; fonts normally go into subdirectories
of /usr/share/fonts.

Yes. There is a test. If the 'reasonable guess' initial directory doesn't
exist, the initdir variable is set to "", which means it starts out in the
current working directory. Once you browse to your font director and pick
something, this is set as default for the rest of the session or until you
change it.

Michael

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton