From 6d695dc816fe102f049bf8ee265f987612330a56 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 11 Jul 2014 18:01:50 -0400 Subject: bdf2fbcon: Add a -p option to set the pref --- (limited to 'bin') diff --git a/bin/bdf2fbcon b/bin/bdf2fbcon index 026195d..0482595 100755 --- a/bin/bdf2fbcon +++ b/bin/bdf2fbcon @@ -34,6 +34,7 @@ sub main if (not GetOptions(\%opts, "o=s", "s=s", + "p=s", "h|help", "V|version", )) { @@ -54,6 +55,9 @@ sub main $convert_opts{'w'} =~ s/x.*//; $convert_opts{'h'} =~ s/.*x//; } + if (exists($opts{'p'})) { + $convert_opts{'p'} = $opts{'p'}; + } if ($#ARGV lt 0) { error(4, "No input files\n"); @@ -88,6 +92,7 @@ sub help print($fh "Options:\n"); print($fh " -o Place the output into \n"); print($fh " -s x Override the font size\n"); + print($fh " -p Set the font's preference to \n"); print($fh " -h, --help Display this information\n"); print($fh " -V, --version Display version information\n"); } @@ -180,10 +185,12 @@ sub init_font 'width' => undef, 'height' => undef, 'chars' => [], + 'pref' => 0, }; $font->{'width'} = $opts{'w'} if (exists($opts{'w'})); $font->{'height'} = $opts{'h'} if (exists($opts{'h'})); + $font->{'pref'} = $opts{'p'} if (exists($opts{'p'})); for ($i = 0; $i < 256; ++$i) { $font->{'chars'}[$i] = { @@ -285,8 +292,7 @@ sub write_fbcon 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->{'name'}); - # XXX - printf($output_fh "\t.pref\t= ???,\n"); + printf($output_fh "\t.pref\t= %d,\n", $font->{'pref'}); printf($output_fh "};\n"); } @@ -297,7 +303,7 @@ __END__ =head1 SYNOPSIS B -[B<-o> I] [B<-s> IxI] +[B<-o> I] [B<-s> IxI] [B<-p> I] I ... =head1 DESCRIPTION @@ -317,6 +323,10 @@ Place the output into I. Override the font size. +=item B<-p> I + +Set the font's preference to I. + =item B<-h>, B<--help> Display help information. -- cgit v0.9.1