summaryrefslogtreecommitdiffstats
path: root/bdf2c.pl
diff options
context:
space:
mode:
authordscho <dscho>2001-10-13 15:14:27 +0000
committerdscho <dscho>2001-10-13 15:14:27 +0000
commit9f07e222f828b7b2bf2775b9dc8cd18b22a829c1 (patch)
tree96d8ade36b70799217d3cfd9fb89193c2c1be7a0 /bdf2c.pl
parentac263ce9aa1561847427b71298861594d8623e61 (diff)
downloadlibtdevnc-9f07e222f828b7b2bf2775b9dc8cd18b22a829c1.tar.gz
libtdevnc-9f07e222f828b7b2bf2775b9dc8cd18b22a829c1.zip
rfbSelectBox, consoleFonts, too many changes
Diffstat (limited to 'bdf2c.pl')
-rw-r--r--bdf2c.pl15
1 files changed, 13 insertions, 2 deletions
diff --git a/bdf2c.pl b/bdf2c.pl
index e92b465..fc43712 100644
--- a/bdf2c.pl
+++ b/bdf2c.pl
@@ -20,9 +20,17 @@ while(<>) {
} elsif(/^ENCODING (.*)$/) {
$glyphindex=$1;
$searchfor="BBX";
+ $dwidth=0;
+ } elsif(/^DWIDTH (.*) (.*)/) {
+ $dwidth=$1;
} elsif(/^BBX (.*) (.*) (.*) (.*)$/) {
($width,$height,$x,$y)=($1,$2,$3,$4);
@encodings[$glyphindex*5..($glyphindex*5+4)]=($counter,$width,$height,$x,$y);
+ if($dwidth != 0) {
+ $encodings[$glyphindex*5+1]=$dwidth;
+ } else {
+ $dwidth=$width;
+ }
$searchfor="BITMAP";
} elsif(/^BITMAP/) {
$i=1;
@@ -31,8 +39,11 @@ while(<>) {
$i=0;
$out.=" /* $glyphindex */\n";
} else {
- $_=substr($_,0,length($_)-1);
- $counter+=length($_)/2;
+ if(int(($dwidth+7)/8) > int(($width+7)/8)) {
+ $_ .= "00"x(int(($dwidth+7)/8)-int(($width+7)/8));
+ }
+ $_=substr($_,0,(int(($dwidth+7)/8)*2));
+ $counter+=(int(($dwidth+7)/8));
s/(..)/$nullx$1,/g;
$out.=$_;
$i++;