/*
Type /chrpw to open the table you can right click to copy the ascii value in decimal or hexadecimal and also change the font.
*/
alias chrpw {
if (!%chrpw.font) %chrpw.font = verdana
if (!%chrpw.size) %chrpw.size = 12
window -apdBCf +t @chrpw $calc($window(-1).w /2-181) $calc($window(-1).h /2-191) 362 375
window -dph @chrpw.buffer 0 0 600 600
dgrid
}
alias -l idiv return $int($calc( ($1) / ($2) ))
alias -l d draw $+ $gettok(dot line rect fill text,$1,32) $2-
alias -l c return $rgb($gettok(face shadow hilight 3dlight frame text,$1,32))
alias -l p return @chrpw
alias -l w return $calc($window($p).bw + $1)
alias -l h return $calc($window($p).bh + $1)
alias -l sfont { %chrpw.font = $1- | dgrid }
alias -l dgrid {
d 3 -rfn $p $c(1) 1 0 0 $w $h
var %x 0
d 3 -rn $p $c(3) 1 6 6 22 22
d 3 -rn $p $c(4) 1 5 5 22 22
d 3 -rn $p $c(5) 1 5 5 23 23
%x = 0
while (%x < 256) {
var %t $iif($regex($chr(%x),\S),$chr(%x),$chr(160))
drawcopy -n $p 5 5 23 23 $p $calc(5+22* (%x % 16)) $calc(5+22* $idiv(%x,16))
d 5 -rbn $p $c(6) $c(1) %chrpw.font %chrpw.size $calc(16+22* (%x % 16) - $width(%t,%chrpw.font,%chrpw.size)/2) $calc(8+22* $idiv(%x ,16) -1) %t
inc %x
}
d 5 -rn $p $c(3) verdana 10 120 360 tekhiun.blogspot.com
d 5 -rn $p $c(2) verdana 10 121 361 tekhiun.blogspot.com
d 1 $p
drawcopy $p 0 0 500 500 @chrpw.buffer 0 0 500 500
}
menu @chrpw {
mouse: { var %x $mouse.x , %y $mouse.y
if ($inrect(%x,%y,5,5,352,352)) {
if (%chrpw.pos != $calc($idiv(%x -5,22) + $idiv(%y -5,22)*16)) {
%chrpw.pos = $v2
drawcopy -n @chrpw.buffer 0 0 $w $h $p 0 0
var %i $calc($idiv(%x -5,22)*22-6), %j $calc($idiv(%y -5,22)*22-6) , %u %i , %v %j , %s %chrpw.size * 2.5 , %t $iif($regex($chr(%chrpw.pos),\S),$chr(%chrpw.pos),$chr(160))
if (!$calc(%chrpw.pos % 16)) { %i = 5 | %u = 22 }
if ($calc(%chrpw.pos % 16) = 15) { %i = 316 | %u = 298 }
if (!$idiv(%chrpw.pos,16)) { %j = 5 | %v = 81 }
if ($idiv(%chrpw.pos,16) = 15) { %j = 316 | %v = 316 }
d 3 -rf $p $c(1) 1 %i %j 42 42
d 3 -r $p $c(3) 1 $calc(%i +1) $calc(%j +2) 39 40
d 3 -r $p $c(2) 1 $calc(%i +1) %j 41 41
d 3 -r $p $c(5) 1 %i %j 42 42
d 5 -rbn $p $c(3) $c(2) verdana 11 $calc(%u -14.5) $calc(%v - 16 ) $chr(160) ascii: $base(%chrpw.pos,10,10,3) $chr(160)
d 3 -rn $p $c(5) 1 $calc(%u -14.5) $calc(%v - 16 ) 72 15
if (%j = 316) %v = 237
if (%j = 5) %v = 5
d 5 -rbn $p $c(3) $c(2) verdana 11 $calc(%u -16.5) $calc(%v + 44) $chr(160) hex: 0x $+ $base(%chrpw.pos,10,16,2) $chr(160)
d 3 -rn $p $c(5) 1 $calc(%u -16.5) $calc(%v + 44) $width( $chr(160) hex: 0x $+ $base(%chrpw.pos,10,16,2) $chr(160),verdana,11) 15
d 5 -rbn $p $c(6) $c(1) %chrpw.font %s $calc(%i +21- $width(%t,%chrpw.font,%s)/2) $calc(%j +3) %t
d 1 $p
}
}
if ($inrect(%x,%y,0,360,600,200)) {
d 5 -rbpn $p $c(3) $c(1) verdana 10 118 360 tekhiun.blogspot.com
d 5 -rpn $p $c(3) verdana 10 122 360 tekhiun.blogspot.com
d 5 -rn $p $c(2) verdana 10 120 360 tekhiun.blogspot.com
d 1 $p
}
}
sclick: if ($inrect($mouse.x,$mouse.y,0,360,600,200)) run http://tekhiun.blogspot.com
Copy ascii: clipboard %chrpw.pos
Copy hex: clipboard $base(%chrpw.pos,10,16)
-
Font
.$style(2) Current $chr(58) %chrpw.font : T
.-
.$submenu($mz($1))
.-
.Other : {
var %v $?="Enter font name $crlf $+ ex: wingdings 3"
if (%v) { %chrpw.font = " %v " | dgrid }
}
}
alias -l f { var %f Arial Fixedsys Terminal Verdana Wingdings Webdings
return $gettok($iif($findtok(%f,%chrpw.font,1,32),$deltok(%f,$v1,32),%f),$1,32)
}
alias -l mz {
if ($1 = begin) return -
return $f($1) : sfont $f($1)
if ($1 = end) return stok:3
}
on *:close:@chrpw: window -c @chrpw.buffer
Abonner på:
Kommentarer til indlægget (Atom)
Ingen kommentarer:
Send en kommentar