diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-07-11 23:55:49 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-07-11 23:55:49 (EDT) |
commit | b85d5e2c0c5c214682cc3f35b8fc4df443a5bdb0 (patch) | |
tree | 36a9088e17b03ba1bdb3dd47c1062d14987cd4e6 | |
parent | 2fc1dda5466ece084cc080d839312cc33f96ad9f (diff) |
parse_bdf_2_1(): Add left margin from FIGURE_WIDTH
-rwxr-xr-x | bin/bdf2fbcon | 6 |
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); |