org.foray.font.format
Class FontParser

java.lang.Object
  extended by org.foray.font.format.FontParser

public class FontParser
extends Object

Parses a font file.


Field Summary
static byte FILEFORMAT_OTF_CFF
          Constant indicating that the file is an OpenType font in CFF (Type 1) format.
static byte FILEFORMAT_OTF_TRUETYPE
          Constant indicating that the file is an OpenType font in TrueType format.
static byte FILEFORMAT_TTF_COLLECTION
          Constant indicating that the file is a TrueType collection.
static byte FILEFORMAT_TTF_SINGLEFONT
          Constant indicating that the file is a TrueType file containing only one TrueType font.
static byte FILEFORMAT_TYPE1_MAC
          Constant indicating that the file is a Type 1 file in Macintosh format.
static byte FILEFORMAT_TYPE1_PFA
          Constant indicating that the file is a Type 1 file in PFA (hexadecimal) format.
static byte FILEFORMAT_TYPE1_PFB
          Constant indicating that the file is a Type 1 file in PFB (Microsoft) format.
static byte FILEFORMAT_UNKNOWN
          Consant indicating that the file is in an unknown format.
 
Constructor Summary
FontParser(FontParserClient parserClient, DataSource dataSource)
          Constructor.
 
Method Summary
 FontContent createFontFile()
          Factory method that creates instances of FontFile that know how to read the file's contents.
 byte getFileFormat()
          Returns the format of this font file.
 org.axsl.font.Font.Format getFontFormat()
          Returns the format of this font.
 FontParserClient getFontParserClient()
          Returns the font parser client.
 org.apache.commons.logging.Log getLogger()
          Returns the logger.
 org.axsl.ps.PsServer getPsServer()
          Returns the font server.
 RandomAccessInput getRandomInput()
          Returns the content to be parsed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILEFORMAT_UNKNOWN

public static final byte FILEFORMAT_UNKNOWN
Consant indicating that the file is in an unknown format.

See Also:
Constant Field Values

FILEFORMAT_TYPE1_PFA

public static final byte FILEFORMAT_TYPE1_PFA
Constant indicating that the file is a Type 1 file in PFA (hexadecimal) format. PFA = [P]rinter (or [P]ostscript) [F]ile [A]SCII.

See Also:
Constant Field Values

FILEFORMAT_TYPE1_PFB

public static final byte FILEFORMAT_TYPE1_PFB
Constant indicating that the file is a Type 1 file in PFB (Microsoft) format. PFB = [P]rinter (or [P]ostscript) [F]ile [B]inary.

See Also:
Constant Field Values

FILEFORMAT_TYPE1_MAC

public static final byte FILEFORMAT_TYPE1_MAC
Constant indicating that the file is a Type 1 file in Macintosh format.

See Also:
Constant Field Values

FILEFORMAT_TTF_SINGLEFONT

public static final byte FILEFORMAT_TTF_SINGLEFONT
Constant indicating that the file is a TrueType file containing only one TrueType font.

See Also:
Constant Field Values

FILEFORMAT_TTF_COLLECTION

public static final byte FILEFORMAT_TTF_COLLECTION
Constant indicating that the file is a TrueType collection.

See Also:
Constant Field Values

FILEFORMAT_OTF_TRUETYPE

public static final byte FILEFORMAT_OTF_TRUETYPE
Constant indicating that the file is an OpenType font in TrueType format.

See Also:
Constant Field Values

FILEFORMAT_OTF_CFF

public static final byte FILEFORMAT_OTF_CFF
Constant indicating that the file is an OpenType font in CFF (Type 1) format.

See Also:
Constant Field Values
Constructor Detail

FontParser

public FontParser(FontParserClient parserClient,
                  DataSource dataSource)
           throws IOException,
                  org.axsl.font.FontException
Constructor.

Parameters:
parserClient - The font parser client.
dataSource - The description and content to be parsed.
Throws:
IOException - For errors opening or reading the input stream.
org.axsl.font.FontException - For an unsupported font format.
Method Detail

getFontFormat

public org.axsl.font.Font.Format getFontFormat()
Returns the format of this font.

Returns:
The format of this font.

getFileFormat

public byte getFileFormat()
Returns the format of this font file.

Returns:
The format of this font file.

getLogger

public org.apache.commons.logging.Log getLogger()
Returns the logger.

Returns:
The logger.

getPsServer

public org.axsl.ps.PsServer getPsServer()
Returns the font server.

Returns:
The font server.

getFontParserClient

public FontParserClient getFontParserClient()
Returns the font parser client.

Returns:
The font parser client.

createFontFile

public FontContent createFontFile()
                           throws org.axsl.font.FontException
Factory method that creates instances of FontFile that know how to read the file's contents.

Returns:
A FontFile instance that knows how to read this files contents, or null this is not a recognized font file format.
Throws:
org.axsl.font.FontException - For errors reading content.

getRandomInput

public RandomAccessInput getRandomInput()
Returns the content to be parsed.

Returns:
The content to be parsed.


Copyright © 2017. All rights reserved.