org.apache.fop.fonts
Class FontLoader
java.lang.Object
org.apache.fop.fonts.FontLoader
public abstract class FontLoader
extends java.lang.Object
Base class for font loaders.
protected String | fontFileURI - URI representing the font file
|
protected InputStream | in - the InputStream to load the font from
|
protected boolean | loaded - true if the font has been loaded
|
protected static Log | log - logging instance
|
protected FontResolver | resolver - the FontResolver to use for font URI resolution
|
protected CustomFont | returnFont - the loaded font
|
fontFileURI
protected String fontFileURI
URI representing the font file
in
protected InputStream in
the InputStream to load the font from
loaded
protected boolean loaded
true if the font has been loaded
log
protected static Log log
logging instance
resolver
protected FontResolver resolver
the FontResolver to use for font URI resolution
returnFont
protected CustomFont returnFont
the loaded font
FontLoader
public FontLoader(String fontFileURI,
InputStream in,
FontResolver resolver)
Default constructor.
fontFileURI
- the URI to the PFB file of a Type 1 fontin
- the InputStream reading the PFM file of a Type 1 fontresolver
- the font resolver used to resolve URIs
getFont
public CustomFont getFont()
throws IOException
loadFont
public static CustomFont loadFont(File fontFile,
FontResolver resolver)
throws IOException
Loads a custom font from a File. In the case of Type 1 fonts, the PFB file must be specified.
fontFile
- the File representation of the fontresolver
- the font resolver to use when resolving URIs
loadFont
public static CustomFont loadFont(String fontFileURI,
FontResolver resolver)
throws IOException
Loads a custom font from a URI. In the case of Type 1 fonts, the PFB file must be specified.
fontFileURI
- the URI to the fontresolver
- the font resolver to use when resolving URIs
loadFontFromInputStream
protected static CustomFont loadFontFromInputStream(String fontFileURI,
FontResolver resolver,
boolean isType1,
InputStream in)
throws IOException
Loads and returns a font given an input stream.
fontFileURI
- font file uriresolver
- font resolverisType1
- is it a type1 font?in
- input stream
read
protected abstract void read()
throws IOException
Reads/parses the font data.
Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.