public class ExternalFontMapper
extends com.lowagie.text.pdf.DefaultFontMapper
Constructor and Description |
---|
ExternalFontMapper(java.lang.String[] fontLocations)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
com.lowagie.text.pdf.BaseFont |
awtToPdf(java.awt.Font font) |
static ExternalFontMapper |
createMapperFromResourceList(java.io.InputStream in)
Creates a font mapper given a stream of strings giving resource paths,
for resources available on the classpath.
|
static ExternalFontMapper |
createMapperFromResourcePaths(java.lang.String[] paths)
Creates a font mapper given a list of font resource paths,
for resources available on the classpath.
|
static void |
main(java.lang.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 java.lang.String[] |
readLines(java.io.InputStream in)
Reads lines of text from a stream.
|
static void |
writeLines(java.lang.String[] lines,
java.io.OutputStream out)
Writes lines of text to a stream.
|
public ExternalFontMapper(java.lang.String[] fontLocations)
fontLocations
- locations for font TTF files as supplied to the
FontFactory.register method; URLs work (probably files too)public com.lowagie.text.pdf.BaseFont awtToPdf(java.awt.Font font)
awtToPdf
in interface com.lowagie.text.pdf.FontMapper
awtToPdf
in class com.lowagie.text.pdf.DefaultFontMapper
public static ExternalFontMapper createMapperFromResourcePaths(java.lang.String[] paths)
paths
- absolute resource path strings for TTF filespublic static ExternalFontMapper createMapperFromResourceList(java.io.InputStream in) throws java.io.IOException
createMapperFromResourcePaths(java.lang.String[])
is called.
Each resource is on a separate line, encoding is UTF-8.in
- input streamjava.io.IOException
public static java.lang.String[] readLines(java.io.InputStream in) throws java.io.IOException
in
- input streamjava.io.IOException
public static void writeLines(java.lang.String[] lines, java.io.OutputStream out) throws java.io.IOException
lines
- lines to writeout
- output streamjava.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException
createMapperFromResourceList(java.io.InputStream)
method.args
- list of zip file namesjava.io.IOException
Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.