--- afmtodit.pl.orig 2005-12-09 21:12:30.000000000 +0300 +++ afmtodit.pl 2006-04-02 13:07:06.000000000 +0400 @@ -30,9 +30,9 @@ my $groff_sys_fontdir = "@FONTDIR@"; use Getopt::Std; -getopts('a:d:e:i:mnsvx'); +getopts('a:cd:e:i:mnsvx'); -our ($opt_a, $opt_d, $opt_e, $opt_i, $opt_m, $opt_n, $opt_s, $opt_v, $opt_x); +our ($opt_a, $opt_c, $opt_d, $opt_e, $opt_i, $opt_m, $opt_n, $opt_s, $opt_v, $opt_x); if ($opt_v) { print "GNU afmtodit (groff) version @address@hidden"; @@ -40,7 +40,7 @@ } if ($#ARGV != 2) { - die "usage: $prog [-mnsvx] [-a angle] [-d DESC] [-e encoding]\n" . + die "usage: $prog [-cmnsvx] [-a angle] [-d DESC] [-e encoding]\n" . " [-i n] afmfile mapfile font\n"; } @@ -54,6 +54,7 @@ # read the afm file my $psname; +my ($notice, $version, $fullname, $familyname, @comments); my $italic_angle = 0; my (@kern1, @kern2, @kernx); my (%italic_correction, %left_italic_correction); @@ -67,12 +68,28 @@ open(AFM, $afm) || die "$prog: can't open \`$ARGV[0]': $!\n"; while () { - chop; + chomp; + s/\x0D$//; my @field = split(' '); next if $#field < 0; if ($field[0] eq "FontName") { $psname = $field[1]; } + elsif($field[0] eq "Notice") { + $notice = $_; + } + elsif($field[0] eq "Version") { + $version = $_; + } + elsif($field[0] eq "FullName") { + $fullname = $_; + } + elsif($field[0] eq "FamilyName") { + $familyname = $_; + } + elsif($field[0] eq "Comment") { + push(@comments, $_); + } elsif($field[0] eq "ItalicAngle") { $italic_angle = -$field[1]; } @@ -409,6 +426,16 @@ print("encoding $e\n"); } +if ($opt_c) { + print("# $fullname\n") if defined $fullname; + print("# $version\n") if defined $version; + print("# $familyname\n") if defined $familyname; + print("# $notice\n") if defined $notice; + foreach my $comment (@comments) { + print("# $comment\n"); + } +} + if (!$opt_n && %ligatures) { print("ligatures"); while (my $lig = each %ligatures) {