proc fly:text {string style spacing} { global conf set dir $conf(flytext,fontsetdir)/$style if ![file isdirectory $dir] {return -1} if ![file exists $conf(flytext,imgdir)/$style/${string}.gifa] { set matrixfile [open $conf(flytext,fontsetdir)/$style/matrix r] set matrix [split [read $matrixfile] \n] close $matrixfile set height [lindex [lindex $matrix 0] 1] foreach line [lrange $matrix 1 end] {set charwidth([lindex $line 0]) [lindex $line 1]} set stringproc [string toupper $string] set width 0 for {set x 0} {$x<[string length $stringproc]} {incr x} {incr width [expr $charwidth([string index $stringproc $x])+$spacing]} set fly [open "| $conf(flybin) -o $conf(flytext,imgdir)/$style/${string}.gif" w] puts $fly "new" puts $fly "type gif" puts $fly "size $width,$height" puts $fly "fill 1,1,255,255,255" puts $fly "getpixel 1,1" set width 0 for {set x 0} {$x<[string length $stringproc]} {incr x} { puts $fly "copy $width,0,-1,-1,-1,-1,$dir/[string index $stringproc $x].gif" puts "copy $width,0,-1,-1,-1,-1,$dir/[string index $stringproc $x].gif" incr width [expr $charwidth([string index $stringproc $x])+$spacing] } close $fly } return "" } proc fly:text2 {string style spacing size} { global conf set dir $conf(flytext,fontsetdir)/$style if ![file isdirectory $dir] {return -1} if ![file exists $conf(flytext,imgdir)/$style/${string}.gifa] { set matrixfile [open $conf(flytext,fontsetdir)/$style/matrix r] set matrix [split [read $matrixfile] \n] close $matrixfile set height [lindex [lindex $matrix 0] 1] foreach line [lrange $matrix 1 end] {set charwidth([lindex $line 0]) [lindex $line 1]} set width 0 for {set x 0} {$x<[string length $string]} {incr x} { scan [string index $string $x] %c charcode if ![info exists charwidth($charcode)] {set charcode 93} incr width [expr $charwidth($charcode)+$spacing] } set fly [open "| $conf(flybin) -o $conf(flytext,imgdir)/$style/${string}.gif" w] puts $fly "new" puts $fly "type gif" puts $fly "size $width,$height" puts $fly "fill 1,1,255,255,255" puts $fly "transparent 255,255,255" set width 0 for {set x 0} {$x<[string length $string]} {incr x} { scan [string index $string $x] %c charcode if ![info exists charwidth($charcode)] {set charcode 93} puts $fly "copy $width,0,-1,-1,-1,-1,$dir/${charcode}.gif" incr width [expr $charwidth($charcode)+$spacing] } close $fly } return "" }