]> git.donarmstrong.com Git - lilypond.git/blobdiff - buildscripts/mf2pt1.pl
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / buildscripts / mf2pt1.pl
index d3624e77b5fd160e3e6506babbb4308c9e70dbc0..804fc1f999a4727e265c5d27a686394078725e5c 100644 (file)
@@ -7,7 +7,7 @@
 
 ########################################################################
 # mf2pt1                                                               #
-# Copyright (C) 2007 Scott Pakin                                       #
+# Copyright (C) 2008 Scott Pakin                                       #
 #                                                                      #
 # This program may be distributed and/or modified under the conditions #
 # of the LaTeX Project Public License, either version 1.3c of this     #
@@ -21,7 +21,7 @@
 # version 2006/05/20 or later.                                         #
 ########################################################################
 
-our $VERSION = "2.4.2";   # mf2pt1 version number
+our $VERSION = "2.4.4";   # mf2pt1 version number
 require 5.6.1;            # I haven't tested mf2pt1 with older Perl versions
 
 use File::Basename;
@@ -160,7 +160,7 @@ my $filedir;
 my $filenoext;
 my $versionmsg = "mf2pt1 version $VERSION
 
-Copyright (C) 2007 Scott Pakin
+Copyright (C) 2008 Scott Pakin
 
 This program may be distributed and/or modified under the conditions
 of the LaTeX Project Public License, either version 1.3c of this
@@ -340,9 +340,9 @@ sub assign_default (\$@)
     my $varptr = shift;        # Pointer to variable to define
     return if defined $$varptr && $$varptr ne "UNSPECIFIED";
     foreach my $val (@_) {
-       next if !defined $val;
-       $$varptr = $val;
-       return;
+        next if !defined $val;
+        $$varptr = $val;
+        return;
     }
 }
 
@@ -429,7 +429,9 @@ sub get_bboxes ($)
     execute_command 1, ("mpost", "-mem=mf2pt1", "-progname=mpost",
                         "\\mode:=localfont; mag:=$mag; bpppix $bpppix; input $mffile");
     opendir (CURDIR, ".") || die "${progname}: $! ($filedir)\n";
-    @charfiles = grep /^$filebase.*\.\d+$/, readdir(CURDIR);
+    @charfiles = sort
+                   { ($a=~ /\.(\d+)$/)[0] <=> ($b=~ /\.(\d+)$/)[0] }
+                   grep /^$filebase.*\.\d+$/, readdir(CURDIR);
     close CURDIR;
     @fontbbox = (1000000, 1000000, -1000000, -1000000);
     foreach my $psfile (@charfiles) {
@@ -743,7 +745,7 @@ ENDTRAILER
 # commands also defined by Plain Metafont.
 my %opthash = ();
 GetOptions (\%opthash,
-           "fontversion=s",       # font_version
+            "fontversion=s",       # font_version
             "comment=s",           # font_comment
             "family=s",            # font_family
             "weight=s",            # font_weight
@@ -757,7 +759,7 @@ GetOptions (\%opthash,
             "designsize=f",        # font_size (*)
             "encoding=s",          # font_coding_scheme (*)
             "rounding=f",
-           "bpppix=f",
+            "bpppix=f",
             "ffscript=s",
             "h|help",
             "V|version") || pod2usage(2);
@@ -817,18 +819,18 @@ ENCODING:
 {
     if (-e $encoding) {
         # Filenames take precedence over built-in encodings.
-       my @enc_array;
+        my @enc_array;
         open (ENCFILE, "<$encoding") || die "${progname}: $! ($encoding)\n";
-       while (my $oneline = <ENCFILE>) {
-           $oneline =~ s/\%.*$//;
-           foreach my $word (split " ", $oneline) {            
-               push @enc_array, substr($word, 1) if substr($word, 0, 1) eq "/";
-           }
-       }
+        while (my $oneline = <ENCFILE>) {
+            $oneline =~ s/\%.*$//;
+            foreach my $word (split " ", $oneline) {
+                push @enc_array, substr($word, 1) if substr($word, 0, 1) eq "/";
+            }
+        }
         close ENCFILE;
-       $encoding_name = substr (shift @enc_array, 1);
+        $encoding_name = substr (shift @enc_array, 1);
         $encoding = \@enc_array;
-       last ENCODING;
+        last ENCODING;
     }
     $encoding=\@standardencoding,  last ENCODING  if $encoding eq "standard";
     $encoding=\@isolatin1encoding, last ENCODING  if $encoding eq "isolatin1";