#!/usr/local/bin/perl $count_file = './.count'; $len = 5; #桁数 @digits = (0x00,0x00,0x00,0x3c,0x66,0x66,0x66,0x66, 0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00, 0x00,0x00,0x00,0x30,0x38,0x30,0x30,0x30, 0x30,0x30,0x30,0x30,0x30,0x00,0x00,0x00, 0x00,0x00,0x00,0x3c,0x66,0x60,0x60,0x30, 0x18,0x0c,0x06,0x06,0x7e,0x00,0x00,0x00, 0x00,0x00,0x00,0x3c,0x66,0x60,0x60,0x38, 0x60,0x60,0x60,0x66,0x3c,0x00,0x00,0x00, 0x00,0x00,0x00,0x30,0x30,0x38,0x38,0x34, 0x34,0x32,0x7e,0x30,0x78,0x00,0x00,0x00, 0x00,0x00,0x00,0x7e,0x06,0x06,0x06,0x3e, 0x60,0x60,0x60,0x66,0x3c,0x00,0x00,0x00, 0x00,0x00,0x00,0x38,0x0c,0x06,0x06,0x3e, 0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00, 0x00,0x00,0x00,0x7e,0x66,0x60,0x60,0x30, 0x30,0x18,0x18,0x0c,0x0c,0x00,0x00,0x00, 0x00,0x00,0x00,0x3c,0x66,0x66,0x66,0x3c, 0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00, 0x00,0x00,0x00,0x3c,0x66,0x66,0x66,0x66, 0x7c,0x60,0x60,0x30,0x1c,0x00,0x00,0x00 ); open(COUNT, "+< $count_file"); flock(COUNT, 2); $cnt = ; $cnt++; seek(COUNT, 0, 0); print COUNT $cnt; close(COUNT); print "Content-type: image/xbm\n\n"; $text = sprintf("%0${len}u",$cnt); printf "#define count_width %d\n#define count_height 16\n", $len*8; printf "static char count_bits[] = {\n"; for ($y=0; $y < 16; $y++) { #スマートじゃないけど for ($x=0; $x < $len; $x++) { $d = substr($text,$x,1) - '0'; print '0x'; printf "%1x",($digits[($d * 16) + $y] >> 4) & 0xf; printf "%1x",$digits[($d * 16) + $y] & 0xf; if ($x < $len-1) { print ','; } } if ($y==15) { print '};'; } else { print ','; } print "\n"; } exit;