[PD-cvs] pd/src desire.tk,1.1.2.413,1.1.2.414

chunlee chunlee at users.sourceforge.net
Mon Aug 28 17:18:39 CEST 2006


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

Modified Files:
      Tag: devel_0_39
	desire.tk 
Log Message:
font settings now also in ddrc


Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.413
retrieving revision 1.1.2.414
diff -C2 -d -r1.1.2.413 -r1.1.2.414
*** desire.tk	28 Aug 2006 02:30:23 -0000	1.1.2.413
--- desire.tk	28 Aug 2006 15:18:36 -0000	1.1.2.414
***************
*** 518,525 ****
  set look(Thing:fontstyle) normal
  set look(Thing:fontitalic) 0
! set look(Thing:fontstr2) "-*-courier-medium--normal--%d-*"
! set look(Thing:fontstr) [format -*-courier-medium--normal--%d-* $look(Thing:fontsize)]
! set look(Thing:fontwidth)  [font measure $look(Thing:fontstr) W]
! set look(Thing:fontheight) [font metrics $look(Thing:fontstr) -linespace]
  set look(Thing:fontpady) 3
  set look(Thing:fontpadx) 5
--- 518,525 ----
  set look(Thing:fontstyle) normal
  set look(Thing:fontitalic) 0
! set look(Thing:fontstring2) "-*-courier-medium--normal--%d-*"
! set look(Thing:fontstring) [format -*-courier-medium--normal--%d-* $look(Thing:fontsize)]
! set look(Thing:fontwidth) [font measure $look(Thing:fontstring) W]
! set look(Thing:fontheight) [font metrics $look(Thing:fontstring) -linespace]
  set look(Thing:fontpady) 3
  set look(Thing:fontpadx) 5
***************
*** 1017,1021 ****
  }
  
! 
  #-----------------------------------------------------------------------------------#
  proc read_ddrc {} {
--- 1017,1046 ----
  }
  
! #-----------------------------------------------------------------------------------#
! proc set_fontstring {} {
!   global look
!   set fstring ""
!   set name $look(Thing:fontfamily); set style $look(Thing:fontstyle)
!   set italic $look(Thing:fontitalic); set size $look(Thing:fontsize)
!   if {$style == "bold"} {
!     set fstring "*-$name-bold"
!   } else {
!     set fstring "*-$name-medium"
!   }
!   if {$italic} {
!     if {$name == "Helvetica" || $name == "Courier"} {
!       set look(Thing:fontstring) "$fstring-o-normal--$size-*"
!       set look(Thing:fontstring2)"$fstring-o-normal--%d-*"
!     } else {
!       set look(Thing:fontstring) "$fstring-i-normal--$size-*"
!       set look(Thing:fontstring2) "$fstring-i-normal--%d-*"
!     }
!   } else {
!     set look(Thing:fontstring) "$fstring-r-normal--$size-*"
!     set look(Thing:fontstring2) "$fstring-r-normal--%d-*"
!   }
!   set look(Thing:fontwidth) [font measure $look(Thing:fontstring) W]
!   set look(Thing:fontheight) [font metrics $look(Thing:fontstring) -linespace]
! }
  #-----------------------------------------------------------------------------------#
  proc read_ddrc {} {
***************
*** 1040,1044 ****
  	}
  
! 
  	#if {[regexp {^#} $line comment]} {continue} ;# skip comments
  }
--- 1065,1069 ----
  	}
  
! 	set_fontstring
  	#if {[regexp {^#} $line comment]} {continue} ;# skip comments
  }
***************
*** 1118,1121 ****
--- 1143,1147 ----
  	}
  }
+ 
  def Thing getkey {k} {
  	global accels
***************
*** 1153,1157 ****
  			set new_size [format %.0f [expr [$self look fontsize]*$zoom]]
  			#set s [format $font(str2) $new_size]
! 			set s [format [$self look fontstr2] $new_size]
  			set args [lreplace $args [expr $find + 1] [expr $find + 1] $s]
  		}
--- 1179,1183 ----
  			set new_size [format %.0f [expr [$self look fontsize]*$zoom]]
  			#set s [format $font(str2) $new_size]
! 			set s [format [$self look fontstring2] $new_size]
  			set args [lreplace $args [expr $find + 1] [expr $find + 1] $s]
  		}
***************
*** 1696,1700 ****
  	#	-font $font(str) -text $@text -fill [$self look fg] -anchor nw
  	$self item TEXT text [l+ {2 2} [list $x1 $y1]] \
! 		-font [$self look fontstr] -text $@text -fill [$self look fg] -anchor nw
      }
      $self update_size
--- 1722,1726 ----
  	#	-font $font(str) -text $@text -fill [$self look fg] -anchor nw
  	$self item TEXT text [l+ {2 2} [list $x1 $y1]] \
! 		-font [$self look fontstring] -text $@text -fill [$self look fg] -anchor nw
      }
      $self update_size
***************
*** 1720,1724 ****
  	set new_size [format %.0f [expr [$self look fontsize]*$_($@canvas:zoom)]]
  	#set font_str [format $font(str2) $new_size]
! 	set font_str [format [$self look fontstr2] $new_size]
  	text $t -height 1 -width [expr [string length $@text]+1] -relief flat \
  		-bg [.$@canvas.c itemcget ${self}BASE -fill] -borderwidth 0 -highlightthickness 0\
--- 1746,1750 ----
  	set new_size [format %.0f [expr [$self look fontsize]*$_($@canvas:zoom)]]
  	#set font_str [format $font(str2) $new_size]
! 	set font_str [format [$self look fontstring2] $new_size]
  	text $t -height 1 -width [expr [string length $@text]+1] -relief flat \
  		-bg [.$@canvas.c itemcget ${self}BASE -fill] -borderwidth 0 -highlightthickness 0\
***************
*** 3347,3351 ****
  	#	-text $string -fill [$self look fg] -font $font(str) -anchor nw
  	$self item TEXT text [l+ {2 2} [list $x1 $y1]] \
! 		-text $string -fill [$self look fg] -font [$self look fontstr] -anchor nw
  }
  
--- 3373,3377 ----
  	#	-text $string -fill [$self look fg] -font $font(str) -anchor nw
  	$self item TEXT text [l+ {2 2} [list $x1 $y1]] \
! 		-text $string -fill [$self look fg] -font [$self look fontstring] -anchor nw
  }
  
***************
*** 3792,3796 ****
  	#	-font $font(str) -fill [parse_color $@fcol]
  	$self item NUMBER text [list $xt $yt] -anchor w -text $@text \
! 		-font [$self look fontstr] -fill [parse_color $@fcol]
  	$c delete ${self}CURS
  	if {[string length $@buf]>0} {
--- 3818,3822 ----
  	#	-font $font(str) -fill [parse_color $@fcol]
  	$self item NUMBER text [list $xt $yt] -anchor w -text $@text \
! 		-font [$self look fontstring] -fill [parse_color $@fcol]
  	$c delete ${self}CURS
  	if {[string length $@buf]>0} {
***************
*** 4291,4295 ****
  	#	-fill [$self look fg] -anchor nw
  	$self item TEXT text [list $x1 $y1] \
! 		-font [$self look fontstr] -text "an array named '$@name' should appear in this patch" \
  		-fill [$self look fg] -anchor nw
  }
--- 4317,4321 ----
  	#	-fill [$self look fg] -anchor nw
  	$self item TEXT text [list $x1 $y1] \
! 		-font [$self look fontstring] -text "an array named '$@name' should appear in this patch" \
  		-fill [$self look fg] -anchor nw
  }
***************
*** 5120,5124 ****
  }
  
! def Dialog add_fontbomb {f args} {
      set no_max_label 0
      bind all <KeyPress-F1> help
--- 5146,5151 ----
  }
  
! def* Dialog add_fontbomb {f args} {
!     if {[winfo exists $f.font]} {return}
      set no_max_label 0
      bind all <KeyPress-F1> help
***************
*** 5127,5135 ****
  	set @style [$self look fontstyle]
  	set @italic [$self look fontitalic]
! 	set @fstr [$self look fontstr]
  	set bold 0
  	set italic 0
  	set previewtext "Sample text"
- 
  	frame $f.font
  	pack [label $f.font.label -text "Name:" -anchor w] -side top -fill x
--- 5154,5162 ----
  	set @style [$self look fontstyle]
  	set @italic [$self look fontitalic]
! 	set @fstr [$self look fontstring]
! 	puts "font:: $@font | size::: $@size | style::: $@style | italic::: $@italic"
  	set bold 0
  	set italic 0
  	set previewtext "Sample text"
  	frame $f.font
  	pack [label $f.font.label -text "Name:" -anchor w] -side top -fill x
***************
*** 5673,5677 ****
    key Canvas about
  section Client font
!   font Client font
  section Client others
    crosshair Canvas hairstate
--- 5700,5707 ----
    key Canvas about
  section Client font
!   font Thing fontsize
!   font Thing fontfamily
!   font Thing fontstyle
!   font Thing fontitalic
  section Client others
    crosshair Canvas hairstate
***************
*** 5752,5758 ****
  	set fd [open $cmdline(ddrcfilename) w]
  	#set fd [open ~/.ddrc2 w]
! 	set LOOK [list color crosshair bar]
  	set categories [list $LOOK key]; set categories2 [list look key]; set cat_count 0
! 	set classes [list Canvas View Comment Wire FutureWire SelRect Client]
  	set conf {}
  	foreach category $categories {
--- 5782,5788 ----
  	set fd [open $cmdline(ddrcfilename) w]
  	#set fd [open ~/.ddrc2 w]
! 	set LOOK [list color crosshair bar font]
  	set categories [list $LOOK key]; set categories2 [list look key]; set cat_count 0
! 	set classes [list Thing Canvas View Comment Wire FutureWire SelRect Client]
  	set conf {}
  	foreach category $categories {
***************
*** 5772,5781 ****
  		while {$x>=0} {
  			foreach y [lindex $tmp [expr $x+1]] {
! 				if {$sub != "key"} {set str "look($class:$y)"; puts "$class:$y"
  				} else {set str "key($class:$y)"}
  				if {[info exists $str]} {
  				lappend tmp2 [list $y [set [set str]]]
- 				#lappend tmp2 $y
- 				#lappend tmp2 [set [set str]]
  				} else {puts "not exists::: $str"}
  			}
--- 5802,5809 ----
  		while {$x>=0} {
  			foreach y [lindex $tmp [expr $x+1]] {
! 				if {$sub != "key"} {set str "look($class:$y)"
  				} else {set str "key($class:$y)"}
  				if {[info exists $str]} {
  				lappend tmp2 [list $y [set [set str]]]
  				} else {puts "not exists::: $str"}
  			}
***************
*** 5795,5799 ****
  	puts $fd $conf
  	close $fd
! 
  }
  
--- 5823,5827 ----
  	puts $fd $conf
  	close $fd
! 	set_fontstring
  }
  
***************
*** 5839,5842 ****
--- 5867,5882 ----
  				set look($class:$name) $_($self:$var)
  			}
+ 			font {
+ 				set str [string tolower $class$name]
+ 				set str2 ${str}path
+ 				$self font_get_xlfd $@$str2 $@font $@style $@size
+ 				#puts " fontstring::: $@str "
+ 				set look(Thing:fontsize) $@size
+ 				set look(Thing:fontfamily) $@font
+ 				set look(Thing:fontstyle) $@style
+ 				set look(Thing:fontitalic) $@italic
+ 				#set look($class:$name) $look($class:$name)
+ 				#puts "  $class:$name ::: $look($class:$name)"
+ 			}
  		}
  	}
***************
*** 5991,5994 ****
--- 6031,6037 ----
  	    font {
  	    	puts "	adding font bomb"
+ 		set str [string tolower $class$name]
+                 set str2 ${str}path
+ 		set @$str2 $which_section
  	    	$self add_fontbomb $which_section [list [lindex $str 0] toggle]
  	    }
***************
*** 6010,6017 ****
  	set look(Thing:fontstyle) $@style
  	set look(Thing:fontitalic) $@italic
- 	set look(Thing:fontstr) $@str
- 	set look(Thing:fontstr2) $@str2
- 	set look(Thing:fontwidth)  [font measure $@str W]
- 	set look(Thing:fontheight) [font metrics $@str -linespace]
  	puts "	font :: $@font"
  	puts "	size :: $@size"
--- 6053,6056 ----
***************
*** 6020,6024 ****
  	puts "	str :: $@str"
  	puts "	str2 :: $@str2"
! 	
  }
  
--- 6059,6063 ----
  	puts "	str :: $@str"
  	puts "	str2 :: $@str2"
! 	set_fontstring
  }
  





More information about the Pd-cvs mailing list