public class FontFactoryImp
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
boolean |
defaultEmbedding
This is the default value of the embedded variable.
|
java.lang.String |
defaultEncoding
This is the default encoding to use.
|
private java.util.Hashtable |
fontFamilies
This is a map of fontfamilies.
|
private java.util.Properties |
trueTypeFonts
This is a map of postscriptfontnames of True Type fonts and the path of their ttf- or ttc-file.
|
private static java.lang.String[] |
TTFamilyOrder |
| Constructor and Description |
|---|
FontFactoryImp()
Creates new FontFactory
|
| Modifier and Type | Method and Description |
|---|---|
Font |
getFont(java.util.Properties attributes)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
float size)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
float size,
java.awt.Color color)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
float size,
int style)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
float size,
int style,
java.awt.Color color)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
java.lang.String encoding)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
java.lang.String encoding,
boolean embedded)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
java.lang.String encoding,
boolean embedded,
float size)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
java.lang.String encoding,
boolean embedded,
float size,
int style)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
java.lang.String encoding,
boolean embedded,
float size,
int style,
java.awt.Color color)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
java.lang.String encoding,
boolean embedded,
float size,
int style,
java.awt.Color color,
boolean cached)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
java.lang.String encoding,
float size)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
java.lang.String encoding,
float size,
int style)
Constructs a
Font-object. |
Font |
getFont(java.lang.String fontname,
java.lang.String encoding,
float size,
int style,
java.awt.Color color)
Constructs a
Font-object. |
java.util.Set |
getRegisteredFamilies()
Gets a set of registered fontnames.
|
java.util.Set |
getRegisteredFonts()
Gets a set of registered fontnames.
|
boolean |
isRegistered(java.lang.String fontname)
Checks if a certain font is registered.
|
void |
register(java.lang.String path)
Register a ttf- or a ttc-file.
|
void |
register(java.lang.String path,
java.lang.String alias)
Register a font file and use an alias for the font contained in it.
|
int |
registerDirectories()
Register fonts in some probable directories.
|
int |
registerDirectory(java.lang.String dir)
Register all the fonts in a directory.
|
int |
registerDirectory(java.lang.String dir,
boolean scanSubdirectories)
Register all the fonts in a directory and possibly its subdirectories.
|
void |
registerFamily(java.lang.String familyName,
java.lang.String fullName,
java.lang.String path)
Register a font by giving explicitly the font family and name.
|
private java.util.Properties trueTypeFonts
private static java.lang.String[] TTFamilyOrder
private java.util.Hashtable fontFamilies
public java.lang.String defaultEncoding
public boolean defaultEmbedding
public Font getFont(java.lang.String fontname, java.lang.String encoding, boolean embedded, float size, int style, java.awt.Color color)
Font-object.fontname - the name of the fontencoding - the encoding of the fontembedded - true if the font is to be embedded in the PDFsize - the size of this fontstyle - the style of this fontcolor - the Color of this font.public Font getFont(java.lang.String fontname, java.lang.String encoding, boolean embedded, float size, int style, java.awt.Color color, boolean cached)
Font-object.fontname - the name of the fontencoding - the encoding of the fontembedded - true if the font is to be embedded in the PDFsize - the size of this fontstyle - the style of this fontcolor - the Color of this font.cached - true if the font comes from the cache or is added to
the cache if new, false if the font is always created newpublic Font getFont(java.util.Properties attributes)
Font-object.attributes - the attributes of a Font object.public Font getFont(java.lang.String fontname, java.lang.String encoding, boolean embedded, float size, int style)
Font-object.fontname - the name of the fontencoding - the encoding of the fontembedded - true if the font is to be embedded in the PDFsize - the size of this fontstyle - the style of this fontpublic Font getFont(java.lang.String fontname, java.lang.String encoding, boolean embedded, float size)
Font-object.fontname - the name of the fontencoding - the encoding of the fontembedded - true if the font is to be embedded in the PDFsize - the size of this fontpublic Font getFont(java.lang.String fontname, java.lang.String encoding, boolean embedded)
Font-object.fontname - the name of the fontencoding - the encoding of the fontembedded - true if the font is to be embedded in the PDFpublic Font getFont(java.lang.String fontname, java.lang.String encoding, float size, int style, java.awt.Color color)
Font-object.fontname - the name of the fontencoding - the encoding of the fontsize - the size of this fontstyle - the style of this fontcolor - the Color of this font.public Font getFont(java.lang.String fontname, java.lang.String encoding, float size, int style)
Font-object.fontname - the name of the fontencoding - the encoding of the fontsize - the size of this fontstyle - the style of this fontpublic Font getFont(java.lang.String fontname, java.lang.String encoding, float size)
Font-object.fontname - the name of the fontencoding - the encoding of the fontsize - the size of this fontpublic Font getFont(java.lang.String fontname, float size, java.awt.Color color)
Font-object.fontname - the name of the fontsize - the size of this fontcolor - the Color of this font.public Font getFont(java.lang.String fontname, java.lang.String encoding)
Font-object.fontname - the name of the fontencoding - the encoding of the fontpublic Font getFont(java.lang.String fontname, float size, int style, java.awt.Color color)
Font-object.fontname - the name of the fontsize - the size of this fontstyle - the style of this fontcolor - the Color of this font.public Font getFont(java.lang.String fontname, float size, int style)
Font-object.fontname - the name of the fontsize - the size of this fontstyle - the style of this fontpublic Font getFont(java.lang.String fontname, float size)
Font-object.fontname - the name of the fontsize - the size of this fontpublic Font getFont(java.lang.String fontname)
Font-object.fontname - the name of the fontpublic void registerFamily(java.lang.String familyName,
java.lang.String fullName,
java.lang.String path)
familyName - the font familyfullName - the font namepath - the font pathpublic void register(java.lang.String path)
path - the path to a ttf- or ttc-filepublic void register(java.lang.String path,
java.lang.String alias)
path - the path to a font filealias - the alias you want to use for the fontpublic int registerDirectory(java.lang.String dir)
dir - the directorypublic int registerDirectory(java.lang.String dir,
boolean scanSubdirectories)
dir - the directoryscanSubdirectories - recursively scan subdirectories if truepublic int registerDirectories()
public java.util.Set getRegisteredFonts()
public java.util.Set getRegisteredFamilies()
public boolean isRegistered(java.lang.String fontname)
fontname - the name of the font that has to be checked.