[PD-cvs] pd/src s_main.c,1.1.1.4.2.20,1.1.1.4.2.21 u_main.tk,1.1.1.4.2.14,1.1.1.4.2.15

Tim Blechmann timblech at users.sourceforge.net
Sat Oct 23 12:22:11 CEST 2004


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14756

Modified Files:
      Tag: devel_0_37
	s_main.c u_main.tk 
Log Message:
changing font to courier and adding -fontname feature

Index: s_main.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_main.c,v
retrieving revision 1.1.1.4.2.20
retrieving revision 1.1.1.4.2.21
diff -C2 -d -r1.1.1.4.2.20 -r1.1.1.4.2.21
*** s_main.c	19 Oct 2004 11:14:48 -0000	1.1.1.4.2.20
--- s_main.c	23 Oct 2004 10:22:08 -0000	1.1.1.4.2.21
***************
*** 75,78 ****
--- 75,79 ----
  static int sys_version;
  int sys_oldtclversion;	    /* hack to warn g_rtext.c about old text sel */
+ char sys_font[20]; /* tb: font name */
  char *rcfilename;
  
***************
*** 482,487 ****
  	    .../bin/pd
  	    .../lib/pd/bin/pd-gui
! 	    .../lib/pd/doc
!     	To decide which, we stat .../lib/pd; if that exists, we assume it's
  	the complicated layout.  In MSW, it's the "simple" layout, but
  	the gui program is straight wish80:
--- 483,488 ----
  	    .../bin/pd
  	    .../lib/pd/bin/pd-gui
! 	    .../lib/pd/doc 
!    	To decide which, we stat .../lib/pd; if that exists, we assume it's
  	the complicated layout.  In MSW, it's the "simple" layout, but
  	the gui program is straight wish80:
***************
*** 735,738 ****
--- 736,747 ----
      	    argv += 2;
      	}
+ 		/* tb: font name { */
+     	else if (!strcmp(*argv, "-fontname") && argc > 1)
+     	{
+ 			strcpy(sys_font,*(argv+1));
+ 			argc -= 2;
+ 			argv += 2;
+ 		}
+ 		/* } tb */
      	else if (!strcmp(*argv, "-verbose"))
      	{

Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.1.1.4.2.14
retrieving revision 1.1.1.4.2.15
diff -C2 -d -r1.1.1.4.2.14 -r1.1.1.4.2.15
*** u_main.tk	16 Sep 2004 13:53:20 -0000	1.1.1.4.2.14
--- u_main.tk	23 Oct 2004 10:22:08 -0000	1.1.1.4.2.15
***************
*** 268,272 ****
      set name [format ".help%d" $doc_number]
      toplevel $name
!     text $name.text -relief raised -bd 2 -font -*-tahoma---normal--12-* \
      	-yscrollcommand "$name.scroll set" -background white
      scrollbar $name.scroll -command "$name.text yview"
--- 268,272 ----
      set name [format ".help%d" $doc_number]
      toplevel $name
!     text $name.text -relief raised -bd 2 -font -*-courier-bold--normal--12-* \
      	-yscrollcommand "$name.scroll set" -background white
      scrollbar $name.scroll -command "$name.text yview"
***************
*** 1873,1877 ****
      set $var_iemgui_gn_f [expr [eval concat $$var_iemgui_gn_f] + 1]
      if {[eval concat $$var_iemgui_gn_f] > 2} {set $var_iemgui_gn_f 0}
!     if {[eval concat $$var_iemgui_gn_f] == 0} {$id.gnfs.fb configure -text "tahoma" -font {courier 10 bold}}
      if {[eval concat $$var_iemgui_gn_f] == 1} {$id.gnfs.fb configure -text "helvetica" -font {helvetica 10 bold}}
      if {[eval concat $$var_iemgui_gn_f] == 2} {$id.gnfs.fb configure -text "times" -font {times 10 bold}}
--- 1873,1877 ----
      set $var_iemgui_gn_f [expr [eval concat $$var_iemgui_gn_f] + 1]
      if {[eval concat $$var_iemgui_gn_f] > 2} {set $var_iemgui_gn_f 0}
!     if {[eval concat $$var_iemgui_gn_f] == 0} {$id.gnfs.fb configure -text "courier" -font {courier 10 bold}}
      if {[eval concat $$var_iemgui_gn_f] == 1} {$id.gnfs.fb configure -text "helvetica" -font {helvetica 10 bold}}
      if {[eval concat $$var_iemgui_gn_f] == 2} {$id.gnfs.fb configure -text "times" -font {times 10 bold}}
***************
*** 2213,2217 ****
      label $id.gnfs.f_lab -text "font:" -width 6
      if {[eval concat $$var_iemgui_gn_f] == 0} {
!         button $id.gnfs.fb -text "tahoma" -font {courier 10 bold} -width 7 -command "iemgui_toggle_font $id" }
      if {[eval concat $$var_iemgui_gn_f] == 1} {
          button $id.gnfs.fb -text "helvetica" -font {helvetica 10 bold} -width 7 -command "iemgui_toggle_font $id" }
--- 2213,2217 ----
      label $id.gnfs.f_lab -text "font:" -width 6
      if {[eval concat $$var_iemgui_gn_f] == 0} {
!         button $id.gnfs.fb -text "courier" -font {courier 10 bold} -width 7 -command "iemgui_toggle_font $id" }
      if {[eval concat $$var_iemgui_gn_f] == 1} {
          button $id.gnfs.fb -text "helvetica" -font {helvetica 10 bold} -width 7 -command "iemgui_toggle_font $id" }
***************
*** 2274,2278 ****
          button $id.bcol.c$i -background [format "#%6.6x" $hexcol] \
  	    -activebackground [format "#%6.6x" $hexcol] \
!             -font {tahoma 2 normal} -padx 7 -pady 6 \
              -command [format "iemgui_preset_col %s %d" $id $hexcol] }
      pack $id.bcol.c0 $id.bcol.c1 $id.bcol.c2 $id.bcol.c3 $id.bcol.c4 \
--- 2274,2278 ----
          button $id.bcol.c$i -background [format "#%6.6x" $hexcol] \
  	    -activebackground [format "#%6.6x" $hexcol] \
!             -font {courier 2 normal} -padx 7 -pady 6 \
              -command [format "iemgui_preset_col %s %d" $id $hexcol] }
      pack $id.bcol.c0 $id.bcol.c1 $id.bcol.c2 $id.bcol.c3 $id.bcol.c4 \
***************
*** 2285,2289 ****
  	button $id.fcol.c$i -background [format "#%6.6x" $hexcol] \
  	    -activebackground [format "#%6.6x" $hexcol] \
!             -font {tahoma 2 normal} -padx 7 -pady 6 \
              -command [format "iemgui_preset_col %s %d" $id $hexcol] }
      pack $id.fcol.c0 $id.fcol.c1 $id.fcol.c2 $id.fcol.c3 $id.fcol.c4 \
--- 2285,2289 ----
  	button $id.fcol.c$i -background [format "#%6.6x" $hexcol] \
  	    -activebackground [format "#%6.6x" $hexcol] \
!             -font {courier 2 normal} -padx 7 -pady 6 \
              -command [format "iemgui_preset_col %s %d" $id $hexcol] }
      pack $id.fcol.c0 $id.fcol.c1 $id.fcol.c2 $id.fcol.c3 $id.fcol.c4 \
***************
*** 2296,2300 ****
          button $id.lcol.c$i -background [format "#%6.6x" $hexcol] \
  	    -activebackground [format "#%6.6x" $hexcol] \
!             -font {tahoma 2 normal} -padx 7 -pady 6 \
              -command [format "iemgui_preset_col %s %d" $id $hexcol] }
      pack $id.lcol.c0 $id.lcol.c1 $id.lcol.c2 $id.lcol.c3 $id.lcol.c4 \
--- 2296,2300 ----
          button $id.lcol.c$i -background [format "#%6.6x" $hexcol] \
  	    -activebackground [format "#%6.6x" $hexcol] \
!             -font {courier 2 normal} -padx 7 -pady 6 \
              -command [format "iemgui_preset_col %s %d" $id $hexcol] }
      pack $id.lcol.c0 $id.lcol.c1 $id.lcol.c2 $id.lcol.c3 $id.lcol.c4 \
***************
*** 2589,2593 ****
  
      text $name.text -relief raised -bd 2 -height 40 -width 60 \
!     	-yscrollcommand "$name.scroll set" -font -*-tahoma---normal--12-*
      scrollbar $name.scroll -command "$name.text yview"
      pack $name.scroll -side right -fill y
--- 2589,2593 ----
  
      text $name.text -relief raised -bd 2 -height 40 -width 60 \
!     	-yscrollcommand "$name.scroll set" -font -*-courier-bold--normal--12-*
      scrollbar $name.scroll -command "$name.text yview"
      pack $name.scroll -side right -fill y
***************
*** 2612,2619 ****
  ############ pdtk_text_new -- create a new text object #2###########
  proc pdtk_text_new {canvasname myname x y text font color} {
! #    if {$font < 13} {set fontname [format -*-tahoma-----%d-* $font]}
! #    if {$font >= 13} {set fontname [format -*-tahoma-----%d-* $font]}
      $canvasname create text $x $y \
!     	-font [format -*-tahoma---normal--%d-* $font] \
      	-tags $myname -text $text -fill $color  -anchor nw 
  #    pd [concat $myname size [$canvasname bbox $myname] \;]
--- 2612,2620 ----
  ############ pdtk_text_new -- create a new text object #2###########
  proc pdtk_text_new {canvasname myname x y text font color} {
! #    if {$font < 13} {set fontname [format -*-courier-----%d-* $font]}
! #    if {$font >= 13} {set fontname [format -*-courier-----%d-* $font]}
! 	global pd_fontname
      $canvasname create text $x $y \
!     	-font [format -*-%s-bold--normal--%d-* $pd_fontname $font] \
      	-tags $myname -text $text -fill $color  -anchor nw 
  #    pd [concat $myname size [$canvasname bbox $myname] \;]
***************
*** 2646,2674 ****
  # font sizes 8, 10, 12, 14, 16, and 24.
  
! proc pdtk_pd_startup {version apilist} {
      global pd_myversion pd_apilist
      set pd_myversion $version
      set pd_apilist $apilist
  
!     set width1 [font measure  -*-tahoma---normal--8-* x]
!     set height1 [lindex [font metrics -*-tahoma---normal--8-*] 5]
! 
!     set width2 [font measure  -*-tahoma---normal--10-* x]
!     set height2 [lindex [font metrics -*-tahoma---normal--10-*] 5]
! 
!     set width3 [font measure  -*-tahoma---normal--12-* x]
!     set height3 [lindex [font metrics -*-tahoma---normal--12-*] 5]
! 
!     set width4 [font measure  -*-tahoma---normal--14-* x]
!     set height4 [lindex [font metrics -*-tahoma---normal--14-*] 5]
! 
!     set width5 [font measure  -*-tahoma---normal--16-* x]
!     set height5 [lindex [font metrics -*-tahoma---normal--16-*] 5]
! 
!     set width6 [font measure  -*-tahoma---normal--24-* x]
!     set height6 [lindex [font metrics -*-tahoma---normal--24-*] 5]
  
!     set width7 [font measure  -*-tahoma---normal--36-* x]
!     set height7 [lindex [font metrics -*-tahoma---normal--36-*] 5]
  
      set tclpatch [info patchlevel]
--- 2647,2685 ----
  # font sizes 8, 10, 12, 14, 16, and 24.
  
! #tb: set the font
! proc pdtk_pd_startup {version apilist fontname} {
      global pd_myversion pd_apilist
      set pd_myversion $version
      set pd_apilist $apilist
+ 	
+ 	global pd_fontname
+ 	if {[string length $fontname] == 0} {
+ 		set fontname courier
+ 	}
+ 	set pd_fontname $fontname
+ 	global font1 font2 font3 font4 font5 font 6 font7
  
! 	set font1 [format -*-%s-bold--normal--8-* $fontname]
! 	set font2 [format -*-%s-bold--normal--10-* $fontname]
!  	set font3 [format -*-%s-bold--normal--12-* $fontname]
!  	set font4 [format -*-%s-bold--normal--14-* $fontname]
! 	set font5 [format -*-%s-bold--normal--16-* $fontname]
! 	set font6 [format -*-%s-bold--normal--24-* $fontname]
! 	set font7 [format -*-%s-bold--normal--36-* $fontname]
  
!     set width1 [font measure  $font1 x]
!     set height1 [lindex [font metrics $font1] 5]
!     set width2 [font measure  $font2 x]
!     set height2 [lindex [font metrics $font2] 5]
!     set width3 [font measure  $font3 x]
!     set height3 [lindex [font metrics $font3] 5]
!     set width4 [font measure  $font4 x]
!     set height4 [lindex [font metrics $font4] 5]
!     set width5 [font measure  $font5 x]
!     set height5 [lindex [font metrics $font5] 5]
!     set width6 [font measure  $font6 x]
!     set height6 [lindex [font metrics $font6] 5]
!     set width7 [font measure  $font7 x]
!     set height7 [lindex [font metrics $font7] 5]
  
      set tclpatch [info patchlevel]
***************
*** 2771,2775 ****
  
      text $name.text -relief raised -bd 2 -height 12 -width 60 \
!     	-yscrollcommand "$name.scroll set" -font -*-tahoma---normal--12-*
      scrollbar $name.scroll -command "$name.text yview"
      pack $name.scroll -side right -fill y
--- 2782,2786 ----
  
      text $name.text -relief raised -bd 2 -height 12 -width 60 \
!     	-yscrollcommand "$name.scroll set" -font $font3
      scrollbar $name.scroll -command "$name.text yview"
      pack $name.scroll -side right -fill y





More information about the Pd-cvs mailing list