diff options
author | dscho <dscho> | 2001-10-13 15:14:27 +0000 |
---|---|---|
committer | dscho <dscho> | 2001-10-13 15:14:27 +0000 |
commit | 9f07e222f828b7b2bf2775b9dc8cd18b22a829c1 (patch) | |
tree | 96d8ade36b70799217d3cfd9fb89193c2c1be7a0 /consolefont2c.pl | |
parent | ac263ce9aa1561847427b71298861594d8623e61 (diff) | |
download | libtdevnc-9f07e222f828b7b2bf2775b9dc8cd18b22a829c1.tar.gz libtdevnc-9f07e222f828b7b2bf2775b9dc8cd18b22a829c1.zip |
rfbSelectBox, consoleFonts, too many changes
Diffstat (limited to 'consolefont2c.pl')
-rw-r--r-- | consolefont2c.pl | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/consolefont2c.pl b/consolefont2c.pl new file mode 100644 index 0000000..9196649 --- /dev/null +++ b/consolefont2c.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl + +# convert a linux console font (8x16 format) to a font definition +# suitable for processing with LibVNCServer + +#if($#ARGV == 0) { exit; } + +foreach $i (@ARGV) { + $fontname = $i; + $fontname =~ s/\.fnt$//; + $fontname =~ s/^.*\///g; + $fontname =~ y/+/_/; + + print STDERR "$i -> $fontname\n"; + + open IN, "<$i"; + print STDERR read(IN,$x,4096); + close(IN); + + open OUT, ">$fontname.h"; + print OUT "unsigned char ".$fontname."FontData[4096+1]={"; + for($i=0;$i<4096;$i++) { + if(($i%16)==0) { + print OUT "\n"; + } + printf OUT "0x%02x,", ord(substr($x,$i)); + } + + print OUT "\n};\nint ".$fontname."FontMetaData[256*5+1]={\n"; + for($i=0;$i<256;$i++) { + print OUT ($i*16).",8,16,0,0,"; + } + + print OUT "};\nrfbFontData ".$fontname."Font = { ".$fontname."FontData, " + .$fontname."FontMetaData };\n"; + + close OUT; +} |