From c9aa4b7de6aa0ceaeca628c2b30a913781d5c758 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 11 Jul 2014 18:42:17 -0400 Subject: parse_bdf_2_1(): Get bboxes and look for BITMAP --- 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 { } } } -- cgit v0.9.1