diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-07-11 18:42:17 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-07-11 18:42:17 (EDT) |
commit | c9aa4b7de6aa0ceaeca628c2b30a913781d5c758 (patch) | |
tree | 3c09e4eb36180cd23c39e3aa292d21fee95c0885 | |
parent | 6d695dc816fe102f049bf8ee265f987612330a56 (diff) |
parse_bdf_2_1(): Get bboxes and look for BITMAP
-rwxr-xr-x | bin/bdf2fbcon | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/bin/bdf2fbcon b/bin/bdf2fbcon index 0482595..f7501b1 100755 --- a/bin/bdf2fbcon +++ b/bin/bdf2fbcon @@ -15,6 +15,7 @@ use constant { BDF_2_1_SECTION_NONE => 0, BDF_2_1_SECTION_PROPERTIES => 1, BDF_2_1_SECTION_CHAR => 2, + BDF_2_1_SECTION_BITMAP => 3, }; my $VERSION; @@ -212,6 +213,12 @@ sub parse_bdf_2_1 my $stmt; my $arg; my @argv; + my $font_bbox_x; + my $font_bbox_y; + my $char_bbox_w; + my $char_bbox_h; + my $char_bbox_x; + my $char_bbox_y; my $char; $section = BDF_2_1_SECTION_NONE; @@ -229,6 +236,8 @@ sub parse_bdf_2_1 unless ($font->{'height'}) { $font->{'height'} = $argv[1]; } + $font_bbox_x = $argv[2]; + $font_bbox_y = $argv[3]; } elsif ($stmt eq 'COMMENT') { push(@{$font->{'comments'}}, $arg); } elsif ($stmt eq 'STARTPROPERTIES') { @@ -252,8 +261,18 @@ sub parse_bdf_2_1 } elsif ($section == BDF_2_1_SECTION_CHAR) { if ($stmt eq 'ENCODING') { $font->{'chars'}[$argv[0]]->{'name'} = $char; - } elsif ($stmt eq 'ENDCHAR') { + } 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') { + $section = BDF_2_1_SECTION_BITMAP; + } + } elsif ($section == BDF_2_1_SECTION_BITMAP) { + if ($stmt eq 'ENDCHAR') { $section = BDF_2_1_SECTION_NONE; + } else { } } } |