org.apache.fontbox.ttf

Class TTFParser

public class TTFParser extends Object

A true type font file parser.

Version: $Revision: 1.2 $

Author: Ben Litchfield (ben@benlitchfield.com)

Method Summary
static voidmain(String[] args)
A simple command line program to test parsing of a TTF file.
TrueTypeFontparseTTF(String ttfFile)
Parse a file and get a true type font.
TrueTypeFontparseTTF(File ttfFile)
Parse a file and get a true type font.
TrueTypeFontparseTTF(InputStream ttfData)
Parse a file and get a true type font.
TrueTypeFontparseTTF(TTFDataStream raf)
Parse a file and get a true type font.

Method Detail

main

public static void main(String[] args)
A simple command line program to test parsing of a TTF file.
usage: java org.pdfbox.ttf.TTFParser <ttf-file>

Parameters: args The command line arguments.

Throws: IOException If there is an error while parsing the font file.

parseTTF

public TrueTypeFont parseTTF(String ttfFile)
Parse a file and get a true type font.

Parameters: ttfFile The TTF file.

Returns: A true type font.

Throws: IOException If there is an error parsing the true type font.

parseTTF

public TrueTypeFont parseTTF(File ttfFile)
Parse a file and get a true type font.

Parameters: ttfFile The TTF file.

Returns: A true type font.

Throws: IOException If there is an error parsing the true type font.

parseTTF

public TrueTypeFont parseTTF(InputStream ttfData)
Parse a file and get a true type font.

Parameters: ttfData The TTF data to parse.

Returns: A true type font.

Throws: IOException If there is an error parsing the true type font.

parseTTF

public TrueTypeFont parseTTF(TTFDataStream raf)
Parse a file and get a true type font.

Parameters: raf The TTF file.

Returns: A true type font.

Throws: IOException If there is an error parsing the true type font.

Copyright © 2008-2011 Apache Software Foundation. All Rights Reserved.