#!/usr/bin/perl -w

#
#  mk100to75aliases.pl
#      Generates 75dpi-names for 100dpi-fonts
#
#  Usage:
#      cd <dir_with_fonts>
#      mk100to75aliases.pl <fonts.dir >>fonts.alias
#

require 5.001;

use strict;

my $line;
my $font;
my $alias;

<>; # Skip the count

SCAN: while (<>)
{
    $line = $_;
    $line =~ /^.+?\s+(.*)$/;
    $font = $1;

    $font =~ /^(-.*?-.*?-.*?-.*?-.*?-.*?)-(.*?)-.*?-(.*?-.*?)-(.*?-.*?-.*?-.*?)$/  ||
        next SCAN;
    $3 eq "100-100"  ||  next SCAN;

    $alias = "$1-$2-$2"."0-75-75-$4";

    if ($font =~ / /  ||  $alias =~ / /)
    {
        print "\"$alias\" \"$font\"\n";
    }
    else
    {
        print "$alias $font\n";
    }
}
