|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.pdf.DefaultFontMapper
uk.ac.starlink.ttools.plot.ExternalFontMapper
public class ExternalFontMapper
IText FontMapper implementation that works with externally supplied TTF files. It is suitable for use with JLatexMath. The paths of externally stored TTF files are supplied to the mapper at construction time. There are utility methods for extracting lists of the locations of such paths from supplied zip (or jar) files.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.lowagie.text.pdf.DefaultFontMapper |
---|
com.lowagie.text.pdf.DefaultFontMapper.BaseFontParameters |
Constructor Summary | |
---|---|
ExternalFontMapper(String[] fontLocations)
Constructor. |
Method Summary | |
---|---|
com.lowagie.text.pdf.BaseFont |
awtToPdf(Font font)
|
static ExternalFontMapper |
createMapperFromResourceList(InputStream in)
Creates a font mapper given a stream of strings giving resource paths, for resources available on the classpath. |
static ExternalFontMapper |
createMapperFromResourcePaths(String[] paths)
Creates a font mapper given a list of font resource paths, for resources available on the classpath. |
static void |
main(String[] args)
When given the names of one or more zip/jar files as arguments, this writes to standard output the absolute paths of any entries that appear to be a TTF file. |
static String[] |
readLines(InputStream in)
Reads lines of text from a stream. |
static void |
writeLines(String[] lines,
OutputStream out)
Writes lines of text to a stream. |
Methods inherited from class com.lowagie.text.pdf.DefaultFontMapper |
---|
getBaseFontParameters |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExternalFontMapper(String[] fontLocations)
fontLocations
- locations for font TTF files as supplied to the
FontFactory.register method; URLs work (probably files too)Method Detail |
---|
public com.lowagie.text.pdf.BaseFont awtToPdf(Font font)
awtToPdf
in interface com.lowagie.text.pdf.FontMapper
awtToPdf
in class com.lowagie.text.pdf.DefaultFontMapper
public static ExternalFontMapper createMapperFromResourcePaths(String[] paths)
paths
- absolute resource path strings for TTF files
public static ExternalFontMapper createMapperFromResourceList(InputStream in) throws IOException
createMapperFromResourcePaths(java.lang.String[])
is called.
Each resource is on a separate line, encoding is UTF-8.
in
- input stream
IOException
public static String[] readLines(InputStream in) throws IOException
in
- input stream
IOException
public static void writeLines(String[] lines, OutputStream out) throws IOException
lines
- lines to writeout
- output stream
IOException
public static void main(String[] args) throws IOException
createMapperFromResourceList(java.io.InputStream)
method.
args
- list of zip file names
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |