外部変形は データのやり取りをテキストファイルで行うので プログラム言語は 自由に選ぶことができます。図形は機能的かつシンプルなため、数多くのユーザーに受け入れられています。
tclshで文字寸法を取得する(hcw,hch,hcd,hcc)
:tclshで文字寸法を取得する(hcw,hch,hcd,hcc)
@echo off
for /f "delims=:" %%n in ('findstr /n "^#!" %0') do (
copy jwc_temp.txt myfiles > nul
more +%%n %0 | tclsh - > jwc_temp.txt
)
goto:eof
REM #jww
REM #e
#!この次の行からプログラムを書いてください
set cn ""
set f [open myfiles]
foreach 0 [split [read $f] \n] {
switch -regexp -- $0 {
^hcw {
for {set i 1} {$i <= 10} {incr i} {
set hcw([format "%d" $i]) [lindex $0 $i]
}
}
^hch {
for {set i 1} {$i <= 10} {incr i} {
set hch([format "%d" $i]) [lindex $0 $i]
}
}
^hcd {
for {set i 1} {$i <= 10} {incr i} {
set hcd([format "%d" $i]) [lindex $0 $i]
}
}
^hcc {
for {set i 1} {$i <= 10} {incr i} {
set hcc([format "%d" $i]) [lindex $0 $i]
}
}
^cn[0-9] {
set pcn [string range $0 2 end]
if {$cn == ""} {
set cn $pcn
set n [string length $cn]
if {$n < 3} {
set cw $hcw($cn)
set ch $hch($cn)
set cd $hcd($cn)
set cc $hcc($cn)
} else {
lassign $cn pcn cw ch cd cc
set cn $pcn
}
}
break
}
}
}
close $f
puts "h#cn$cn $cw $ch $cd $cc"