summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-07-11 22:04:28 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-07-11 22:04:28 (EDT)
commitc38b9e2c744e8fc9186360ad9ddb62c8eb59424a (patch)
treea00b5f9e887f219245358f5258c724dd7baba51f
parent98174cb391042ba9201423aeb2766300f473f61a (diff)
parse_bdf_2_1(): Populate bitmap without offsets
-rwxr-xr-xbin/bdf2fbcon8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/bdf2fbcon b/bin/bdf2fbcon
index 85e469e..0d4d99c 100755
--- a/bin/bdf2fbcon
+++ b/bin/bdf2fbcon
@@ -220,6 +220,8 @@ sub parse_bdf_2_1
my $char_bbox_x;
my $char_bbox_y;
my $char;
+ my $encoding;
+ my $y;
$section = BDF_2_1_SECTION_NONE;
$found_end = 0;
@@ -260,19 +262,23 @@ sub parse_bdf_2_1
}
} elsif ($section == BDF_2_1_SECTION_CHAR) {
if ($stmt eq 'ENCODING') {
- $font->{'chars'}[$argv[0]]->{'name'} = $char;
+ $encoding = $argv[0];
+ $font->{'chars'}[$encoding]->{'name'} = $char;
} elsif ($stmt eq 'BBX') {
$char_bbox_w = $argv[0];
$char_bbox_y = $argv[1];
$char_bbox_x = $argv[2];
$char_bbox_y = $argv[3];
} elsif ($stmt eq 'BITMAP') {
+ $y = 0;
$section = BDF_2_1_SECTION_BITMAP;
}
} elsif ($section == BDF_2_1_SECTION_BITMAP) {
if ($stmt eq 'ENDCHAR') {
$section = BDF_2_1_SECTION_NONE;
} else {
+ $font->{'chars'}[$encoding]->{'bitmap'}[$y++] =
+ ord($line);
}
}
}