SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

BotDetect - Real-Time Bot Detection API
 
 

MAN page from Old RedHat 6.X perl-PostScript-Font-1.01-6.i386.rpm

lib::PostScript::Font

Section: User Contributed Perl Documentation (3)
Updated: perl 5.005, patch 03
Index 

NAME

PostScript::Font - module to fetch data from PostScript fonts 

SYNOPSIS

  my $info = new PostScript::Font (filename, options);  print STDOUT ("Name = ", $info->FontName, "\n");
 

DESCRIPTION

This package reads PostScript font files and stores the information in memory.

Most font file formats that are in use are recognised, especially theType 1 and Type 42 font formats. Other formats that usually parse okayare Type 5 and Type 3, although Type 3 can sometimes fail depending onhow weird the font information is stored.

The input font file can be encoded in ASCII (so-called .pfaformat), or binary (so-called .pfb format).

True Type fonts are understood as well, they are converted internallyto Type 42 format. Currently this requires an external program,ttftot42. This program will be used automatically if it can belocated in the execution PATH. Alternatively, you can set thevariable $PostScript::Font::ttftot42 (or$PostScript::FontMetrics::ttftot42) to the name of the actualprogram. See also the section on EXTERNAL PROGRAMS. 

CONSTRUCTOR


new ( FILENAME [ , OPTIONS ] )
The constructor will read the file and parse its contents.
 

OPTIONS


error => [ `die' | `warn' | `ignore' ]
How errors must be handled. Default is to call die().In any case, new() returns a undefined result.
format => [ `ascii' | `pfa' | `binary' | `pfb' ]
The format in which the font data is stored.Default is 'ascii', suitable to be downloaded to a PostScript printer.
verbose => value
Prints verbose info if value is true.
trace => value
Prints tracing info if value is true.
debug => value
Prints debugging info if value is true.Implies `trace' and `verbose'.
 

INSTANCE METHODS

Each of these methods can return undef if the correspondinginformation could not be found in the file.
FileName
The name of the file, e.g. `tir_____.pfb'.
FontName
The name of the font, e.g. `Times-Roman'.
FamilyName
The family name of the font, e.g. `Times'.
Version
The version of the font, e.g. `001.007'.
ItalicAngle
The italicity of the font, e.g. 0 (normal upright fonts) or -16 (italic font).
isFixedPitch
Indicates if this font has fixed pitch.
Weight
This font weight.
FontType
The font type, e.g. `1' for a Type 1 PostScript font, or `t' for aTrue Type font.

True Type fonts will be converted to Type 42 internally, but stillhave `t' as FontType.

FontMatrix
The font matrix as a reference to an anonymous array with the 6 values.To find the font scale, use

    int(1/$font->FontMatrix->[0])

DataFormat
The format in which the data is kept internally. See the format option.
FontData
The complete contents of the file, normalised to Unix-style line endings.It is in the format as returned by the DataFormat method.
Encoding
This is either one of the strings 'StandardEncoding' or'ISOLatin1Encoding', or a reference to an array that holds theencoding. In this case, the array will contain a glyph name (a string)for each element that is encoded.

NOTE: Getting the encoding information can fail if the way it wasstored in the font is not recognized by the parser. This is mostlikely to happen with manually constructed fonts.

EncodingVector
Like encoding, but always returns a reference to the encodingarray. In other words, the standard encodings are returned as arraysas well.
FontGlyphs
This returns a reference to an array holding all the names of theglyphs this font defines, in the order the definitions occur in thefont data.

NOTE: Getting the glyphs information can fail if the way it wasstored in the font is not recognized by the parser. This is mostlikely to happen with manually constructed fonts.

Extracting the glyphs can be slow. It can be speeded up by using theexternal program t1disasm. This program will be used automatically,if it can be found in the execution PATH. Alternatively, you canset the variable $PostScript::Font::t1disasm to point to thet1disasm program. This does not apply to type 42 fonts, since thesefonts do not require disassembly to get at the glyph list.

 

CLASS METHODS


StandardEncoding
Returns a reference to an array that contains all the glyphs names forAdobe's Standard Encoding.
ISOLatin1Encoding
Returns a reference to an array that contains all the glyphs names forISO-8859-1 (ISO Latin-1) encoding.
 

EXTERNAL PROGRAMS

Two external programs can be used by this package.

ttftot42 is required when True Type fonts must be handled. It iscalled as follows:

    ttftot42 -fc filename
This invocation will write the Type 42 version of the True Type font tostandard output.

ttftot42 can be found on http://ftp.giga.or.at/pub/nih/ttftot42

An alternative, but not encouraged, way to handle True Type fonts isby converting them to Type 1 fonts. An excellent converter, ttf2pt1,can be used for this. To use this program, create a fake ttftot42script and set variable $PostScript::Font::ttftot42 to the name ofthis script. The script should contain something like this:

    $!/bin/sh    shift       # get rid of '-fc' argument    exec ttf2pt1 -ef "$@" - 2>/dev/null
The redirection of error output to /dev/null is necessary. since theprogram is quite verbose. Unfortunately, error messages will disappearas well.

ttf2pt1 can be found on http://www.netspace.net.au/~mark/ttf2pt1

Note: the resultant Type1 font is not a real conversion, but a(very similar) imitation of the original True Type font. Smalldifferences may be noticable depending on the font quality.

t1disasm can be used to speed up the fetching of the list of fontglyphs from Type 1 fonts. It is called as follows:

    t1disasm filename
This invocation will write the disassembled version of the Type 1 fontto standard output. t1disasm is part of the t1utils package thatcan be found at http://www.lcdf.org/~eddietwo/type/ and several otherplaces. 

KNOWN BUGS

Invoking external programs (t1disasm, ttftot42) is guaranteed towork on Unix only. 

SEE ALSO


http://www.adobe.com/supportservice/devrelations/PDFS/TN/T1_SPEC.PDF
The specification of the Type 1 font format.
http://www.adobe.com/supportservice/devrelations/PDFS/TN/5012.Type42_Spec.pdf
The specification of the Type 42 font format.
http://fonts.apple.com/TTRefMan/index.html
The True Type reference manual.
http://www.adobe.com/supportservice/devrelations/PDFS/TN/5004.AFM_Spec.pdf
The specification of the Adobe font metrics file format.
 

AUTHOR

Johan Vromans, Squirrel Consultancy <jvromansAATTsquirrel.nl> 

COPYRIGHT and DISCLAIMER

This program is Copyright 2000,1998 by Squirrel Consultancy. Allrights reserved.

This program is free software; you can redistribute it and/or modifyit under the terms of either: a) the GNU General Public License aspublished by the Free Software Foundation; either version 1, or (atyour option) any later version, or b) the ``Artistic License'' whichcomes with Perl.

This program is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either theGNU General Public License or the Artistic License for more details.


 

Index

NAME
SYNOPSIS
DESCRIPTION
CONSTRUCTOR
OPTIONS
INSTANCE METHODS
CLASS METHODS
EXTERNAL PROGRAMS
KNOWN BUGS
SEE ALSO
AUTHOR
COPYRIGHT and DISCLAIMER

This document was created byman2html,using the manual pages.
 
ICM Bot detect detector