public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* A font size patch for large screens.
@ 1999-08-11  2:18 Moses DeJong
  1999-08-11 10:36 ` James Ingham
  0 siblings, 1 reply; 5+ messages in thread
From: Moses DeJong @ 1999-08-11  2:18 UTC (permalink / raw)
  To: insight

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.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-08-11 11:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-11  2:18 A font size patch for large screens Moses DeJong
1999-08-11 10:36 ` James Ingham
1999-08-11 11:27   ` Moses DeJong
1999-08-11 11:55     ` James Ingham
1999-08-11 11:56     ` James Ingham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).