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)
endElement
public void endElement(String uri,
String localName,
String qName)
throws SAXException
getFont
public Typeface getFont()
Get the generated font object
setDocumentLocator
public void setDocumentLocator(Locator 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()
startElement
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.