com.flagstone.transform.util.font
Class TTFDecoder

java.lang.Object
  extended by com.flagstone.transform.util.font.TTFDecoder
All Implemented Interfaces:
FontDecoder, FontProvider

public final class TTFDecoder
extends Object
implements FontProvider, FontDecoder

TTFDecoder decodes TrueType or OpenType Fonts so they can be used in a Flash file.


Constructor Summary
TTFDecoder()
           
 
Method Summary
 List<Font> getFonts()
          Get the list of fonts decoded.
 FontDecoder newDecoder()
          The method implemented by all FontDecoders in order to be registered with the FontRegistry and used by the FontFactory to decode fonts.
 void read(File file)
          Read a font from a file.
 void read(InputStream stream)
          Read a font from an input stream.
 void read(URL url)
          Read a font from a file referenced by a URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TTFDecoder

public TTFDecoder()
Method Detail

newDecoder

public FontDecoder newDecoder()
The method implemented by all FontDecoders in order to be registered with the FontRegistry and used by the FontFactory to decode fonts.

Specified by:
newDecoder in interface FontProvider
Returns:
an object that implements the FontDecoder interface.

read

public void read(File file)
          throws IOException,
                 DataFormatException
Read a font from a file.

Specified by:
read in interface FontDecoder
Parameters:
file - the path to the file.
Throws:
IOException - if there is an error reading the font data.
DataFormatException - if the file contains an unsupported format.

read

public void read(URL url)
          throws IOException,
                 DataFormatException
Read a font from a file referenced by a URL.

Specified by:
read in interface FontDecoder
Parameters:
url - the reference to the file.
Throws:
IOException - if there is an error reading the font data.
DataFormatException - if the file contains an unsupported format.

getFonts

public List<Font> getFonts()
Get the list of fonts decoded.

Specified by:
getFonts in interface FontDecoder
Returns:
a list of fonts.

read

public void read(InputStream stream)
          throws IOException
Read a font from an input stream.

Parameters:
stream - the stream containing the font data.
Throws:
IOException - if there is an error reading the font data.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.