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

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.

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

Thanks,

~ Eric.

(attachments)

Small_tcltk_font.png
Custom_app_example.png

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.

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

funny, for me (Debian/Etch) that "Map Display 1" text is huge.

Hamish

      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

I think it might have to do woth the DPI setting on your Xserver. I recently changed from a miscalculated 75x75 dpi to a proper 120x121, and now most of my fonts are very small...

--Wolf

On 29.04.2008 04:52, Hamish wrote:

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.

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

funny, for me (Debian/Etch) that "Map Display 1" text is huge.

Hamish

      ____________________________________________________________________________________
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

--

<:3 )---- Wolf Bergenheim ----( 8:>

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@gclements.plus.com>

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.

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

It's easy enough to do a global find and replace on the relevant tcl files,
and to edit my ~/.Xdefaults; is there anything else I should do to ensure the edits
remain permanently?

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.

Hopefully an update to 8.5 will solve the problem.

Thanks for the hints;

~ Eric.

Patton, Eric wrote:

>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

It's easy enough to do a global find and replace on the relevant tcl files,
and to edit my ~/.Xdefaults; is there anything else I should do to ensure the edits
remain permanently?

Not that I can think of.

However, I think that this should be changed in GRASS. Using pixel
sizes for some fonts and point sizes for others doesn't make any sense
to me.

I would suggest using pixel sizes throughout, as:

1. Tk handles that case fine.

2. Everything else (e.g. the sizes of the images in the toolbar
buttons) is specified in pixels.

[See also: web pages. Font sizes are specified in points, images (and
frames, etc) in pixels. If your browser's "effective" DPI doesn't
match the Windows default of 96 DPI, many over-designed web pages
(i.e. those which try to control the exact layout rather than leaving
it to the browser) have serious formatting errors.]

3. Most monitors have a sufficiently low resolution that the minimum
usable font size is determined by the minimum number of pixels
required to avoid excessive rasteriation artifacts, not the physical
size of the text on the screen.

[My default "12 point" font is probably around 8 points, given that
the display is actually ~112 DPI rather than the 75 DPI that I have
told X to use, and I can still read it.]

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