3 # Create encoding files from the `*.txt' encoding files.
4 # Copyright (c) 1995-1998 Markku Rossi.
5 # Author: Markku Rossi <mtr@iki.fi>
9 # This file is part of GNU Enscript.
11 # Enscript is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation, either version 3 of the License, or
14 # (at your option) any later version.
16 # Enscript is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with Enscript. If not, see <http://www.gnu.org/licenses/>.
30 print "usage: make-encoding.pl encfile\n";
36 open(FP, $file) || die "couldn't open input file `$file': $!\n";
38 # Find the start of the table.
48 die "file `$file' is not a valid encoding file: couldn't find table\n";
60 * This file is automatically generated from file \`$file.txt\'. If you
61 * have any corrections to this file, please, edit file \`$file.txt\' instead.
65 * Enscript is free software: you can redistribute it and/or modify
66 * it under the terms of the GNU General Public License as published by
67 * the Free Software Foundation, either version 3 of the License, or
68 * (at your option) any later version.
70 * Enscript is distributed in the hope that it will be useful,
71 * but WITHOUT ANY WARRANTY; without even the implied warranty of
72 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
73 * GNU General Public License for more details.
75 * You should have received a copy of the GNU General Public License
76 * along with Enscript. If not, see <http://www.gnu.org/licenses/>.
81 print "#include \"afmint.h\"\n\n";
83 printf("AFMEncodingTable afm_%s_encoding[] =\n{\n",
91 } elsif ($_ =~ /non-printable/) {
92 print " {@cols[1], AFM_ENC_NONE},\n";
93 } elsif (@cols[2] =~ /-/) {
94 print " {@cols[1], AFM_ENC_NON_EXISTENT},\n";
98 print " {@cols[1], \"$name\"},\n";
104 printf(" {-1, NULL},\n};\n");