org.apache.fop.fonts
Class FontReader
DefaultHandler
org.apache.fop.fonts.FontReader
public class FontReader
extends DefaultHandler
Class for reading a metric.xml file and creating a font object.
Typical usage:
FontReader reader = new FontReader();
reader.setFontEmbedPath();
reader.useKerning(true);
Font f = reader.getFont();
FontReader(InputSource source) - Construct a FontReader object from a path to a metric.xml file
and read metric data
|
FontReader
public FontReader(InputSource source)
throws FOPException
Construct a FontReader object from a path to a metric.xml file
and read metric data
source
- Source of the font metric file
characters
public void characters(char[] ch,
int start,
int length)
org.xml.sax.ContentHandler.characters(char[], int, int)
endElement
public void endElement(String uri,
String localName,
String qName)
throws SAXException
org.xml.sax.ContentHandler.endElement(String, String, String)
getFont
public Typeface getFont()
Get the generated font object
setDocumentLocator
public void setDocumentLocator(Locator locator)
org.xml.sax.ContentHandler.setDocumentLocator(Locator)
setFontEmbedPath
public void setFontEmbedPath(String path)
Sets the path to embed a font. A null value disables font embedding.
path
- URI for the embeddable file
setKerningEnabled
public void setKerningEnabled(boolean enabled)
Enable/disable use of kerning for the font
enabled
- true to enable kerning, false to disable
setResolver
public void setResolver(FontResolver resolver)
Sets the font resolver. Needed for URI resolution.
resolver
- the font resolver
startDocument
public void startDocument()
org.xml.sax.ContentHandler.startDocument()
startElement
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
org.xml.sax.ContentHandler.startElement(String, String, String, Attributes)
Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.