From 8f407f8a1ab2adf08c438f40cd797fef8a810dae Mon Sep 17 00:00:00 2001 From: dscho Date: Fri, 5 Oct 2001 20:19:35 +0000 Subject: extracted font routines from example --- bdf2c.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'bdf2c.pl') 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"; -- cgit v1.2.1