public class FontReader extends org.xml.sax.helpers.DefaultHandler
FontReader reader = new FontReader(); reader.setFontEmbedPath( ); reader.useKerning(true); Font f = reader.getFont();
| Constructor and Description |
|---|
FontReader(InputSource source)
Construct a FontReader object from a path to a metric.xml file
and read metric data
|
| Modifier and Type | Method and Description |
|---|---|
void |
characters(char[] ch,
int start,
int length) |
void |
endElement(String uri,
String localName,
String qName) |
Typeface |
getFont()
Get the generated font object
|
void |
setDocumentLocator(Locator locator) |
void |
setFontEmbedPath(String path)
Sets the path to embed a font.
|
void |
setKerningEnabled(boolean enabled)
Enable/disable use of kerning for the font
|
void |
setResolver(FontResolver resolver)
Sets the font resolver.
|
void |
startDocument() |
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes) |
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warningpublic FontReader(InputSource source) throws FOPException
source - Source of the font metric fileFOPException - if loading the font failspublic void setFontEmbedPath(String path)
path - URI for the embeddable filepublic void setKerningEnabled(boolean enabled)
enabled - true to enable kerning, false to disablepublic void setResolver(FontResolver resolver)
resolver - the font resolverpublic Typeface getFont()
public void startDocument()
startDocument in interface ContentHandlerstartDocument in class org.xml.sax.helpers.DefaultHandlerpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class org.xml.sax.helpers.DefaultHandlerpublic void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement in interface ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void endElement(String uri, String localName, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerSAXExceptionpublic void characters(char[] ch,
int start,
int length)
characters in interface ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerCopyright © 2007-2020. All Rights Reserved.