summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bdf2fbcon20
1 files changed, 16 insertions, 4 deletions
diff --git a/bin/bdf2fbcon b/bin/bdf2fbcon
index 23bbb15..21172cd 100755
--- a/bin/bdf2fbcon
+++ b/bin/bdf2fbcon
@@ -32,6 +32,7 @@ sub main
"no_getopt_compat");
if (not GetOptions(\%opts,
"o=s",
+ "n=s",
"s=s",
"p=s",
"h|help",
@@ -49,6 +50,9 @@ sub main
version(*STDOUT);
exit(0);
}
+ if (exists($opts{'n'})) {
+ $convert_opts{'n'} = $opts{'n'};
+ }
if (exists($opts{'s'})) {
$convert_opts{'w'} = $convert_opts{'h'} = $opts{'s'};
$convert_opts{'w'} =~ s/x.*//;
@@ -90,6 +94,7 @@ sub help
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");
@@ -187,6 +192,7 @@ sub init_font
'pref' => 0,
};
+ $font->{'name'} = $opts{'n'} if (exists($opts{'n'}));
$font->{'width'} = $opts{'w'} if (exists($opts{'w'}));
$font->{'height'} = $opts{'h'} if (exists($opts{'h'}));
$font->{'pref'} = $opts{'p'} if (exists($opts{'p'}));
@@ -254,10 +260,12 @@ sub parse_bdf_2_1
}
} elsif ($section == BDF_2_1_SECTION_PROPERTIES) {
if ($stmt eq 'FONT_NAME') {
- $font->{'idx'} = uc($arg);
- $font->{'idx'} =~ s/[^A-Z0-9_]//g;
- $font->{'name'} = lc($arg);
- $font->{'name'} =~ s/[^a-z0-9_]/_/g;
+ unless ($font->{'name'}) {
+ $font->{'idx'} = uc($arg);
+ $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);
@@ -374,6 +382,10 @@ fonts.
Place the output into I<output>.
+=item B<-n> I<name>
+
+Set the font name to I<name>.
+
=item B<-s> I<w>xI<h>
Override the font size.