source: trunk/filemanager/tp/dompdf/lib/ttf2ufm/ttf2ufm-src/app/TeX/sfd2map @ 2000

Revision 2000, 1.6 KB checked in by amuller, 14 years ago (diff)

Ticket #597 - Implementação do módulo gerenciador de arquivos

Line 
1#!/usr/bin/perl -w
2#
3# Copyright (c) 2002 Mike Fabian <mike.fabian@gmx.de>
4#
5# This program is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2, or (at your option)
8# any later version.
9#
10# This program is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13# General Public License for more details.
14
15use English;
16use Getopt::Long;
17
18sub usage {
19  print "Usage: sfd2map [-debug|d]\n\n";
20  print "Converts a .sfd files in the format used by ttf2pk and ttf2tfm\n";
21  print "into .map files in the format expected by ttf2pt1. For example:\n\n";
22  print "    sfd2map < UJIS.sfd > UJIS.map \n\n";
23  exit 1;
24}
25
26# Process command line options
27my %opt;
28unless (GetOptions(\%opt,
29        '-debug|d' , \$OPT_DEBUG
30       )) {
31    &usage();
32    exit 1;
33}
34
35if($OPT_DEBUG) {
36}
37
38open (MAP, ">&STDOUT");
39open (SFD, "<&STDIN");
40
41print MAP "# generated from a .sfd file by sfd2map to make it usable with ttf2pt1\n";
42print MAP "#\n";
43
44while (<SFD>) {
45 
46  if ( ! ($ARG =~ /^[[:space:]]*\#/)) { # skip comment lines
47
48    # handle plane numbers:
49    if ( $ARG =~ /^([[:xdigit:]]{2})[[:space:]]*/ ) {
50      $ARG =~ s/^([[:xdigit:]]{2})[[:space:]]*/   /;
51      print MAP "plane $1\n";
52      print MAP "at 0x00\n";
53    }
54   
55    # remove continuation chars '\':
56    $ARG =~ s/\\$//;
57
58    $ARG =~ s/(0x[[:xdigit:]]{1,4})/$1,/g;
59    # handle ranges like 0xF800_0xF8FF
60    $ARG =~ s/(0x[[:xdigit:]]{1,4}),_/$1-/g;
61   
62  }
63
64  print MAP $ARG;
65
66}
67
68
Note: See TracBrowser for help on using the repository browser.