This is the mail archive of the
insight@sourceware.cygnus.com
mailing list for the Insight project.
A font size patch for large screens.
Moses,
Ooh... You have a nice laptop! Mine can only do 1024x768 (though it
is a PowerBook, so it's ravishingly beautiful...)
Thanks for the patch. The idea is great, but I don't think the
algorithm is quite right, however. I think the laptop case is an
extreme example of many pixels + small physical size. I have a Sun
display at 1280x1024, and 16 is way too big a font for the default.
14 is okay, though a bit on the biggish side, 11 is really pretty
good, though 9 is definately too small.
We should be able to play around with some heuristics involving both
"winfo screenwidth" and "winfo screenmmwidth" to get a better choice.
What do you think?
Jim
> Hi all.
>
> I just downloaded and debugged my first program with insight. It looks
> great, but the default font is much too small on my 1280x1000 laptop screen.
> I have included a patch that adjusts the default font size based on the
> height of the screen and adjust the range of the font size select widget.
>
>
> Mo DeJong
> dejong@cs.umn.edu
>
>
>
>
>
>
> 1999-08-11 Mo DeJong <dejong@cs.umn.edu>
>
> * gdb/gdbtcl2/globalpref.itb
> libgui/library/looknfeel.tcl : Use the screen height to determine
> the default font size. Adjust font selection widget range as well.
>
>
>
> --- insight-19990809/gdb/gdbtcl2/globalpref.itb Sat Jul 17 00:32:46 1999
> +++ ../insight-19990809/gdb/gdbtcl2/globalpref.itb Wed Aug 11 03:13:14 1999@@ -113,7 +113,7 @@
> $frame.icons.cb configure -width $width
>
>
> - # searching for fixed font families take a long time
> + # searching for fixed font families can take a long time
> # therefore, we cache the font names. The font cache
> # can be saved in the init file. A way should be provided
> # to rescan the font list, without deleting the entry from the
> @@ -242,7 +242,10 @@
> $f.${name}n list insert end $a
> }
>
> - tixControl $f.${name}s -label Size: -integer true -max 18 -min 6 \
> + set fontmin [expr {$Original($name,size) * 2 / 3}]
> + set fontmax [expr {$Original($name,size) * 2}]
> +
> + tixControl $f.${name}s -label Size: -integer true -max $fontmax -min $fontmin \
> -value $Original(${name},size) -command [code $this font_changed size $name]
> [$f.${name}s subwidget entry] configure -width 2
> label $f.${name}l -text ABCDEFabcdef0123456789 -font test-$name-font
> --- insight-19990809/libgui/library/looknfeel.tcl Sat Mar 28 04:08:47 1998+++ ../insight-19990809/libgui/library/looknfeel.tcl Wed Aug 11 03:00:45 1999@@ -34,12 +34,21 @@
> eval define_font global/italic [array get actual]
> define_font global/menu -family windows-menu
> } else {
> - define_font global/default -family courier -size 9
> - define_font global/bold -family courier -size 9 -weight bold
> - define_font global/fixed -family courier -size 9
> - define_font global/status -family courier -size 9
> - define_font global/italic -family courier -size 9 -slant italic
> - define_font global/menu -family courier -size 9
> + set def_size 9
> + set screenheight [winfo screenheight .]
> + # if running on a really big display, increase the default font size
> + if {$screenheight > 1200} {
> + set def_size 20
> + } elseif {$screenheight > 1000} {
> + set def_size 16
> + }
> +
> + define_font global/default -family courier -size $def_size
> + define_font global/bold -family courier -size $def_size -weight bold
> + define_font global/fixed -family courier -size $def_size
> + define_font global/status -family courier -size $def_size
> + define_font global/italic -family courier -size $def_size -slant italic
> + define_font global/menu -family courier -size $def_size
> }
>
> # Make sure this font is actually used by default.
>
>
>
>