Ethereal-dev: Re: [ethereal-dev] Font used and screen size

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Wed, 24 Nov 1999 17:38:13 -0800
> I sometimes use Ethereal in 800x600 screen mode, but mostly 1024x768.
> 
> I notice that in 800x600, the font is too large and not enough info fits on
> the screen.  NetMon fits more on the screen.

Just out of curiosity, does NetMon adjust font sizes based on the screen
size?  Or is it just picking a smaller font?

> Can we adjust the font for the display size at all?

We should be able to, if an appropriately-sized font is available.

> I guess that means having to figure out what display size we are on?

Either the size or the resolution.  I'm not sure they're documented in
the GDK documentation at

	http://developer.gnome.org/doc/API/gdk/index.html

(there are many sections, none of which look as if they'd have it), but
GDK has

	gdk_screen_width() - returns the width of the screen, in pixels;

	gdk_screen_height() - returns the height of the screen, in
	    pixels;

	gdk_screen_width_mm() - returns the width of the screen, in
	    millimetres, assuming the server returns a correct value for
	    it (unlike the size in pixels, which can probably be made to
	    reflect reality for certain, the size in mm may have to be
	    supplied *to* the server, and the wrong value might be
	    supplied);

	gdk_screen_height_mm() - returns the height of the screen, in
	    millimetres;

(none of them take an argument; they return the values for the display
and screen GDK are using).

One could perhaps use that to compute the dots/inch resolution, that
being what's used, as I remember, in the XLFD names for most fonts. 
>From that, one could try first searching for a font of the "appropriate"
size (in points, say, as that's what we currently appear to do,
selecting a 12-point font) at the screen's resolution, and then try with
a wildcard resolution, for example.