summaryrefslogtreecommitdiffstats
path: root/bdf2c.pl
diff options
context:
space:
mode:
authordscho <dscho>2001-09-13 09:49:46 +0000
committerdscho <dscho>2001-09-13 09:49:46 +0000
commit8c599f7005877a4d26a9b675cf6f4da2c1c061f0 (patch)
treebf87183f4f2aaa386caa2e625a5f2569ecfaa22d /bdf2c.pl
parent2634379912ea972dedc0d389049945716c90c0db (diff)
downloadlibvncserver-8c599f7005877a4d26a9b675cf6f4da2c1c061f0.zip
libvncserver-8c599f7005877a4d26a9b675cf6f4da2c1c061f0.tar.gz
Now you can write something in addition to mouse movements ...
Diffstat (limited to 'bdf2c.pl')
-rw-r--r--bdf2c.pl44
1 files changed, 44 insertions, 0 deletions
diff --git a/bdf2c.pl b/bdf2c.pl
new file mode 100644
index 0000000..bafd8cc
--- /dev/null
+++ b/bdf2c.pl
@@ -0,0 +1,44 @@
+#!/usr/bin/perl
+
+@encodings=();
+for($i=0;$i<256*5;$i++) {
+ $encodings[$i]="0";
+}
+
+$out="";
+$counter=0;
+
+$i=0;
+$searchfor="";
+$nullx="0x";
+
+while(<>) {
+ if(/^ENCODING (.*)$/) {
+ $glyphindex=$1;
+ $searchfor="BBX";
+ } elsif(/^BBX (.*) (.*) (.*) (.*)$/) {
+ ($width,$height,$x,$y)=($1,$2,$3,$4);
+ @encodings[$glyphindex*5..($glyphindex*5+4)]=($counter,$width,$height,$x,$y);
+ $searchfor="BITMAP";
+ } elsif(/^BITMAP/) {
+ $i=1;
+ } elsif($i>0) {
+ if($i>$height) {
+ $i=0;
+ $out.=" /* $glyphindex */\n";
+ } else {
+ $_=substr($_,0,length($_)-1);
+ $counter+=length($_)/2;
+ s/(..)/$nullx$1,/g;
+ $out.=$_;
+ $i++;
+ }
+ }
+}
+
+print "unsigned char bdffontdata[$counter]={\n" . $out;
+print "};\nint bdffontmetadata[256*5]={\n";
+for($i=0;$i<256*5;$i++) {
+ print $encodings[$i] . ",";
+}
+print "};\n";
OpenPOWER on IntegriCloud