File: application/libraries/dompdf/lib/ttf2ufm/src/app/TeX/sfd2map

Recommend this page to a friend!
  Classes of harold rita  >  PHP Thesis Proposal Hub  >  application/libraries/dompdf/lib/ttf2ufm/src/app/TeX/sfd2map  >  Download  
File: application/libraries/dompdf/lib/ttf2ufm/src/app/TeX/sfd2map
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Thesis Proposal Hub
Store and publish research thesis documents
Author: By
Last change:
Date: 2 years ago
Size: 1,669 bytes


Class file image Download
#!/usr/bin/perl -w
# Copyright (c) 2002 Mike Fabian <>
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# General Public License for more details.

use English;
use Getopt::Long;

sub usage {
  print "Usage: sfd2map [-debug|d]\n\n";
  print "Converts a .sfd files in the format used by ttf2pk and ttf2tfm\n"; 
  print "into .map files in the format expected by ttf2pt1. For example:\n\n";
  print "    sfd2map < UJIS.sfd > \n\n";
  exit 1;

# Process command line options
my %opt;
unless (GetOptions(\%opt,
	'-debug|d' , \$OPT_DEBUG
       )) {
    exit 1;

if($OPT_DEBUG) {

open (MAP, ">&STDOUT");
open (SFD, "<&STDIN");

print MAP "# generated from a .sfd file by sfd2map to make it usable with ttf2pt1\n";
print MAP "#\n";

while (<SFD>) {
  if ( ! ($ARG =~ /^[[:space:]]*\#/)) { # skip comment lines

    # handle plane numbers:
    if ( $ARG =~ /^([[:xdigit:]]{2})[[:space:]]*/ ) {
      $ARG =~ s/^([[:xdigit:]]{2})[[:space:]]*/   /;
      print MAP "plane $1\n";
      print MAP "at 0x00\n";
    # remove continuation chars '\':
    $ARG =~ s/\\$//;

    $ARG =~ s/(0x[[:xdigit:]]{1,4})/$1,/g;
    # handle ranges like 0xF800_0xF8FF
    $ARG =~ s/(0x[[:xdigit:]]{1,4}),_/$1-/g;

  print MAP $ARG;


For more information send a message to info at phpclasses dot org.