summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/bdf2fbcon6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/bdf2fbcon b/bin/bdf2fbcon
index 80e789c..c5790ad 100755
--- a/bin/bdf2fbcon
+++ b/bin/bdf2fbcon
@@ -215,6 +215,7 @@ sub parse_bdf_2_1
my @argv;
my $font_bbox_x;
my $font_bbox_y;
+ my $figure_margin;
my $char_bbox_w;
my $char_bbox_h;
my $char_bbox_x;
@@ -259,7 +260,11 @@ sub parse_bdf_2_1
$font->{'idx'} =~ s/[^A-Z0-9_]//g;
$font->{'name'} = lc($arg);
$font->{'name'} =~ s/[^a-z0-9_]/_/g;
+ } elsif ($stmt eq 'FIGURE_WIDTH') {
+ $figure_margin =
+ int(($font->{'width'} - $arg) / 2);
} elsif ($stmt eq 'ENDPROPERTIES') {
+ $figure_margin = 0 unless ($figure_margin);
$section = BDF_2_1_SECTION_NONE;
}
} elsif ($section == BDF_2_1_SECTION_CHAR) {
@@ -274,6 +279,7 @@ sub parse_bdf_2_1
} elsif ($stmt eq 'BITMAP') {
$bytes_w = int(($char_bbox_w + 7) / 8);
$x = ($font->{'width'} + $font_bbox_x) -
+ $figure_margin -
($bytes_w * 8 + $char_bbox_x);
$y = ($font->{'height'} + $font_bbox_y) -
($char_bbox_h + $char_bbox_y);