summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/bdf2fbcon67
1 files changed, 34 insertions, 33 deletions
diff --git a/bin/bdf2fbcon b/bin/bdf2fbcon
index 0e8e42a..b06d22a 100755
--- a/bin/bdf2fbcon
+++ b/bin/bdf2fbcon
@@ -8,6 +8,7 @@ bdf2fbcon - Convert Glyph Bitmap Distribution Format fonts to Linux fbcon fonts
use strict;
use warnings;
+no indirect;
use Getopt::Long;
@@ -25,7 +26,7 @@ sub warning
{
my ($fmt, @args) = @_;
- printf(STDERR "bdf2fbcon: Warning: " . $fmt . "\n", @args);
+ STDERR->printf("bdf2fbcon: Warning: " . $fmt . "\n", @args);
return;
}
@@ -34,7 +35,7 @@ sub error
{
my ($fmt, @args) = @_;
- printf(STDERR "bdf2fbcon: Error: " . $fmt . "\n", @args);
+ STDERR->printf("bdf2fbcon: Error: " . $fmt . "\n", @args);
return;
}
@@ -202,45 +203,45 @@ sub write_fbcon
}
foreach (@{$font->{'comments'}}) {
- printf($output_fh "/* %s */\n", $_);
+ $output_fh->printf("/* %s */\n", $_);
}
- printf($output_fh "/* Generated by bdf2fbcon */\n\n");
- printf($output_fh "#include <linux/font.h>\n\n");
- printf($output_fh "#define FONTDATAMAX %d\n\n",
+ $output_fh->printf("/* Generated by bdf2fbcon */\n\n");
+ $output_fh->printf("#include <linux/font.h>\n\n");
+ $output_fh->printf("#define FONTDATAMAX %d\n\n",
$bytes_x * $font->{'height'} * 256);
- printf($output_fh "static const unsigned char" .
+ $output_fh->printf("static const unsigned char" .
" fontdata_%s[FONTDATAMAX] = {\n",
$font->{'id'});
foreach my $i (0 .. 255) {
$char = $font->{'chars'}[$i];
- printf($output_fh "\n\t/* %3d 0x%02x '%s' */\n",
+ $output_fh->printf("\n\t/* %3d 0x%02x '%s' */\n",
$i, $i, $char->{'name'});
foreach my $j (0 .. ($font->{'height'} - 1)) {
$bitmap = $char->{'bitmap'}[$j];
$bitmap = 0 unless ($bitmap);
- printf($output_fh "\t");
+ $output_fh->printf("\t");
$shifted_bitmap = $bitmap;
$shifted_bitmap <<= $bytes_x * 8 - $font->{'width'};
foreach my $k (reverse(0 .. ($bytes_x - 1))) {
- printf($output_fh "0x%02x, ",
+ $output_fh->printf("0x%02x, ",
($shifted_bitmap >> ($k * 8)) & 0xFF);
}
- printf($output_fh "/* %0" . $font->{'width'} . "b */\n",
+ $output_fh->printf("/* %0" . $font->{'width'} . "b */\n",
$bitmap);
}
}
- printf($output_fh "\n};\n\n");
- printf($output_fh "const struct font_desc font_%s = {\n",
+ $output_fh->printf("\n};\n\n");
+ $output_fh->printf("const struct font_desc font_%s = {\n",
$font->{'id'});
- printf($output_fh "\t.idx\t= %s_IDX,\n", $font->{'idx'});
- printf($output_fh "\t.name\t= \"%s\",\n", $font->{'idx'});
- printf($output_fh "\t.width\t= %d,\n", $font->{'width'});
- printf($output_fh "\t.height\t= %d,\n", $font->{'height'});
- printf($output_fh "\t.data\t= fontdata_%s,\n", $font->{'id'});
- printf($output_fh "\t.pref\t= %d,\n", $font->{'pref'});
- printf($output_fh "};\n");
+ $output_fh->printf("\t.idx\t= %s_IDX,\n", $font->{'idx'});
+ $output_fh->printf("\t.name\t= \"%s\",\n", $font->{'idx'});
+ $output_fh->printf("\t.width\t= %d,\n", $font->{'width'});
+ $output_fh->printf("\t.height\t= %d,\n", $font->{'height'});
+ $output_fh->printf("\t.data\t= fontdata_%s,\n", $font->{'id'});
+ $output_fh->printf("\t.pref\t= %d,\n", $font->{'pref'});
+ $output_fh->printf("};\n");
if ($output ne "-") {
close($output_fh);
@@ -297,7 +298,7 @@ sub usage
{
my ($fh) = @_;
- printf($fh "Usage: %s [-o <output>] <input> ...\n", $0);
+ $fh->printf("Usage: %s [-o <output>] <input> ...\n", $0);
return;
}
@@ -307,13 +308,13 @@ sub help
my ($fh) = @_;
usage($fh);
- print($fh "Options:\n");
- print($fh " -o <output> Place the output into <output>\n");
- print($fh " -n <name> Set the font name to <name>\n");
- print($fh " -s <w>x<h> Override the font size\n");
- print($fh " -p <pref> Set the font's preference to <pref>\n");
- print($fh " -h, --help Display this information\n");
- print($fh " -V, --version Display version information\n");
+ $fh->print("Options:\n");
+ $fh->print(" -o <output> Place the output into <output>\n");
+ $fh->print(" -n <name> Set the font name to <name>\n");
+ $fh->print(" -s <w>x<h> Override the font size\n");
+ $fh->print(" -p <pref> Set the font's preference to <pref>\n");
+ $fh->print(" -h, --help Display this information\n");
+ $fh->print(" -V, --version Display version information\n");
return;
}
@@ -322,13 +323,13 @@ sub version
{
my ($fh) = @_;
- printf($fh "bdf2fbcon %s\n", $VERSION);
- print($fh "Copyright (C) 2013, 2014 Patrick \"P. J.\" McDermott\n");
- print($fh "License GPLv3+: GNU GPL version 3 or later " .
+ $fh->printf("bdf2fbcon %s\n", $VERSION);
+ $fh->print("Copyright (C) 2013, 2014 Patrick \"P. J.\" McDermott\n");
+ $fh->print("License GPLv3+: GNU GPL version 3 or later " .
"<http://gnu.org/licenses/gpl.html>.\n");
- print($fh "This is free software: you are free to change and " .
+ $fh->print("This is free software: you are free to change and " .
"redistribute it.\n");
- print($fh "There is NO WARRANTY, to the extent permitted by law.\n");
+ $fh->print("There is NO WARRANTY, to the extent permitted by law.\n");
return;
}