[GRASS-user] Small tcltk fonts used in gis.m gui

Glynn Clements glynn at gclements.plus.com
Tue Apr 29 10:59:23 EDT 2008

Patton, Eric wrote:

> I'm pretty sure something strange happened between my upgrade from
> Ubuntu 7.10 to 8.04, but all applications that I use (there's not too
> many) that use tcl/tk as the gui toolkit have really small fonts being
> used. I have attached a screenshot of where this happens in the gis.m
> gui. Also attached is another example from a separate, custom gui I use
> in Grass; you can see the problem is much more apparant.

This probably indicates that it is confused about the scale factor to
convert between points and pixels. It may be that your monitor is
reporting bogus physical dimensions via EDID. Or it may be that you
have some existing configuration settings based upon the historical
default of 75 DPI and those settings are producing undesirable results
when your system uses your monitor's actual resolution.

> Does anyone know how I can re-configure the global font sizes used in
> tcl/tk?

Tk reads ~/.Xdefaults, and uses any "*font: ..." setting found there.

However, gis.m overrides that setting with:

	fontcreate default -family Helvetica -size -12
	option add *font default

The text highlighted in your example uses the "bolddefault" font,
which is defined as:

	fontcreate bolddefault -family Helvetica -size 12 -weight bold

A positive argument to -size (as for "bolddefault") specifies a size
in points, while a negative argument (as for "default") specifies a
size in pixels.

The fact that the former is too small suggests that tk is
underestimating the display resolution, i.e. translating the size of
12 points to too few pixels. With the historical default of 75 DPI, 12
points is 12.5 pixels, so it looks as if Tk thinks that your display
is around 40 DPI.

I have no idea where it gets this information from (or if it's just
hard-coded to 75 DPI). Tk 8.4 doesn't call DisplayWidthMM or
DisplayHeightMM, which is the normal way to determine the physical
screen resolution. However, the list of changes for Tk 8.5 suggest
that the font rendering has been replaced.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-user mailing list