From 628c955c5700f7ec8f9ece9706683c7e5c8eafdd Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 12 Jul 2014 02:02:17 -0400 Subject: bdf2fbcon: Move name and idx normalization logic --- 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", $_); } -- cgit v0.9.1