diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-07-11 22:23:09 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-07-11 22:23:09 (EDT) |
commit | fdbdb55bc2154f47205f45ed170baa0ccaae2d75 (patch) | |
tree | 228d3c1c363cc7dfc89d4daaa93e21f6d0be49ac /bin | |
parent | 6b6fa0191e4629c1ee2c29664c0b2c314d85ff91 (diff) |
write_fbcon(): Fix bitmap iterator & binary string
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bdf2fbcon | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/bdf2fbcon b/bin/bdf2fbcon index bf4f047..8f301f5 100755 --- a/bin/bdf2fbcon +++ b/bin/bdf2fbcon @@ -294,6 +294,7 @@ sub write_fbcon my $char; my $j; my $bitmap; + my $shifted_bitmap; my $k; $bytes_x = int(($font->{'width'} + 7) / 8); @@ -314,12 +315,14 @@ sub write_fbcon printf($output_fh "\n\t/* %3d 0x%02x '%s' */\n", $i, $i, $char->{'name'}); for ($j = 0; $j < $font->{'height'}; ++$j) { - $bitmap = $char->{'bitmap'}[$i]; + $bitmap = $char->{'bitmap'}[$j]; $bitmap = 0 unless ($bitmap); printf($output_fh "\t"); - $bitmap <<= $bytes_x * 8 - $font->{'width'}; + $shifted_bitmap = $bitmap; + $shifted_bitmap <<= $bytes_x * 8 - $font->{'width'}; for (my $k = ($bytes_x - 1) * 8; $k >= 0; $k -= 8) { - printf("0x%02x, ", ($bitmap >> $k) & 0xFF); + printf("0x%02x, ", + ($shifted_bitmap >> $k) & 0xFF); } printf($output_fh "/* %0" . $font->{'width'} . "b */\n", $bitmap); |