summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}
}
}