summaryrefslogtreecommitdiffstats
path: root/bdf2c.pl
diff options
context:
space:
mode:
authordscho <dscho>2001-10-05 20:19:35 +0000
committerdscho <dscho>2001-10-05 20:19:35 +0000
commit8f407f8a1ab2adf08c438f40cd797fef8a810dae (patch)
tree999aab5a3f788f5c6e43621525fdf6515f6bb974 /bdf2c.pl
parent48eb9b22c7097c4af61760ce3fdc7f5135e657bc (diff)
downloadlibtdevnc-8f407f8a1ab2adf08c438f40cd797fef8a810dae.tar.gz
libtdevnc-8f407f8a1ab2adf08c438f40cd797fef8a810dae.zip
extracted font routines from example
Diffstat (limited to 'bdf2c.pl')
-rw-r--r--bdf2c.pl12
1 files changed, 8 insertions, 4 deletions
diff --git a/bdf2c.pl b/bdf2c.pl
index bafd8cc..9eca7b3 100644
--- a/bdf2c.pl
+++ b/bdf2c.pl
@@ -7,13 +7,16 @@ for($i=0;$i<256*5;$i++) {
$out="";
$counter=0;
+$fontname="default";
$i=0;
$searchfor="";
$nullx="0x";
while(<>) {
- if(/^ENCODING (.*)$/) {
+ if(/^FONT (.*)$/) {
+ $fontname=$1;
+ } elsif(/^ENCODING (.*)$/) {
$glyphindex=$1;
$searchfor="BBX";
} elsif(/^BBX (.*) (.*) (.*) (.*)$/) {
@@ -36,9 +39,10 @@ while(<>) {
}
}
-print "unsigned char bdffontdata[$counter]={\n" . $out;
-print "};\nint bdffontmetadata[256*5]={\n";
+print "unsigned char " . $fontname . "FontData[$counter]={\n" . $out;
+print "};\nint " . $fontname . "FontMetaData[256*5]={\n";
for($i=0;$i<256*5;$i++) {
print $encodings[$i] . ",";
}
-print "};\n";
+print "};\nrfbFontData " . $fontname . "Font={" .
+ $fontname . "FontData, " . $fontname . "FontMetaData};\n";