diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-07-15 00:41:34 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-07-15 00:41:34 (EDT) |
commit | 4690c33ce0ae368ed7db3e565c97890b65951de2 (patch) | |
tree | edf0202b25f1141add7b4d10fe7ec99f42b503ef | |
parent | f8d92fddb5cdd6e5738ec33b9dea76e7f2d3b06d (diff) |
scripts/gen-mplus-patch.pl: Improve font sorting
-rwxr-xr-x | scripts/gen-mplus-patch.pl | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/gen-mplus-patch.pl b/scripts/gen-mplus-patch.pl index 33e452a..43c59d3 100755 --- a/scripts/gen-mplus-patch.pl +++ b/scripts/gen-mplus-patch.pl @@ -11,12 +11,12 @@ use Text::Diff; my @FONTS = ( # face weight w h + [qw(1m regular 8 12)], [qw(1m regular 10 14)], [qw(1m regular 12 17)], [qw(1m regular 16 22)], [qw(1m regular 24 34)], [qw(1m regular 32 44)], - [qw(1m regular 8 12)], ); my $PATCH = 'patches/01_add-mplus-fonts.patch'; @@ -211,7 +211,7 @@ sub patch_fonts_c sub conv_fonts { my ($mplus_dir, $bdf2fbcon) = @_; - my $patch; + my %patch; my $face; my $weight; my $width; @@ -219,16 +219,17 @@ sub conv_fonts my $font_name; my $new; - $patch = ''; + %patch = (); foreach my $font (@FONTS) { ($face, $weight, $width, $height) = @$font; $font_name = "mplus-$face-$weight"; $new = `otf2bdf -p $width -r 72 $mplus_dir/$font_name.ttf | \\ $bdf2fbcon -o - -n $font_name -p 2 -`; - $patch .= make_patch("lib/fonts/font_mplus_${face}_${weight}_" . - "${width}x${height}.c", '', $new); + $font_name .= "-${width}x${height}"; + $patch{$font_name} = make_patch("lib/fonts/font_mplus_${face}" . + "_${weight}_${width}x${height}.c", '', $new); } - return $patch; + return join('', @patch{sort(keys(%patch))}); } sub main |