#!/bin/sh
# next line is a comment in tcl \
exec tclsh "$0" ${1+"$@"}

package require Tcldot

set font(1) /usr/add-on/share/ttf/blf.ttf
set font(2) /usr/add-on/share/ttf/atrox.ttf 
set font(3) /usr/add-on/share/ttf/barcod39.ttf 
set font(4) /usr/add-on/share/ttf/bkkoi8bi.ttf 
set font(5) /usr/add-on/share/ttf/bkmaci.ttf 
set font(6) /usr/add-on/share/ttf/times.ttf 

set string "ABC,abc.GJQYZ?gjqyz!M"

set gd [gd create 600 600]
set white [gd color new $gd 255 255 255]
set green [gd color new $gd 0 255 0]
set black [gd color new $gd 0 0 0]

set start [clock clicks]

set angle .5
set x 50
set f 6
if 1 {
	set y 20
	for {set i 4} {$i < 18} {set i [expr $i + .5]} {
		set y [expr $y + round($i) + 5]
#		gd fillpolygon $gd $green [gd text $gd -1 $font($f) $i $angle $x $y "$i: $string"]
		gd text $gd $black $font($f) $i $angle $x $y "$i: $string"
	}

} {
	set y 250
	set i 15.5
	gd fillpolygon $gd $green [gd text $gd -1 $font($f) $i $angle $x $y "$i: $string"]
	gd text $gd $black $font($f) $i $angle $x $y "$i: $string"
}

set y [expr $y + round($i) + 5]
gd text $gd $black $font($f) $i 0 $x $y "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

puts [expr [clock clicks] - $start]
	
set f [open "| xv -" w]
gd writeGIF $gd $f
close $f
