summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-07-12 02:02:17 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-07-12 02:02:17 (EDT)
commit628c955c5700f7ec8f9ece9706683c7e5c8eafdd (patch)
tree10e179dee4b8c27107136b3bc48652a2946e61aa /bin
parent4bd0f4278fe360cd323d0fdd4702a2f24cbedd9b (diff)
bdf2fbcon: Move name and idx normalization logic
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bdf2fbcon12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/bdf2fbcon b/bin/bdf2fbcon
index 21172cd..d3e96ab 100755
--- a/bin/bdf2fbcon
+++ b/bin/bdf2fbcon
@@ -260,12 +260,7 @@ sub parse_bdf_2_1
}
} elsif ($section == BDF_2_1_SECTION_PROPERTIES) {
if ($stmt eq 'FONT_NAME') {
- 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;
- }
+ $font->{'name'} = $arg unless ($font->{'name'});
} elsif ($stmt eq 'FIGURE_WIDTH') {
$figure_margin =
int(($font->{'width'} - $arg) / 2);
@@ -317,6 +312,11 @@ sub write_fbcon
$bytes_x = int(($font->{'width'} + 7) / 8);
+ $font->{'idx'} = uc($font->{'name'});
+ $font->{'idx'} =~ s/[^A-Z0-9_]/_/g;
+ $font->{'name'} = lc($font->{'name'});
+ $font->{'name'} =~ s/[^a-z0-9_]/_/g;
+
for (@{$font->{'comments'}}) {
printf($output_fh "/* %s */\n", $_);
}