|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.icesoft.pdf.pobjects.fonts.FontManager
The FontManager class is responsible for finding available
fonts on the client operating system. This class by default checks the
following directories when the readSystemFonts method is called without any
parameters.
The default font directories are as follows:
It is possible to specify other directories to search for fonts via the
readSystemFonts methods extraFontPaths parameter readSystemFonts(java.lang.String[]).
Reading all of an operating systems font's can be time consuming. To help
speed up this process the method getFontProperties exports font data via a
Properties object. The font Properties object can then be saved to disk or
be read back into the FontManager via the setFontProperties method.
| Field Summary | |
static int |
WEIGHT_BOLD
Indicates that a font's weight is bold. |
static int |
WEIGHT_NORMAL
Indicates that a font's weight is normal. |
| Constructor Summary | |
FontManager()
|
|
| Method Summary | |
String[] |
getAvailableFamilies()
Gets all available font family names on the operating system. |
String[] |
getAvailableNames()
Gets all available font names on the operating system. |
String[] |
getAvailableStyle()
Gets all available font styles on the operating system. |
NFont |
getChineseSimplifiedInstance(String name,
int fontFlags)
|
NFont |
getChineseTraditionalInstance(String name,
int fontFlags)
|
Properties |
getFontProperties()
Gets a Properties object containing font information for the operating system which the FontManager is running on. |
static FontManager |
getInstance()
Returns a static instance of the FontManager class. |
NFont |
getInstance(String name,
int flags)
Get an instance of a NFont from the given font name and flag decoration information. |
NFont |
getJapaneseInstance(String name,
int fontFlags)
|
NFont |
getKoreanInstance(String name,
int fontFlags)
|
static String |
guessFamily(String name)
Utility method for guessing a font family name from its base name. |
static int |
guessWeight(String name)
Utility method for guessing the weight of a family. |
void |
readSystemFonts(String[] extraFontPaths)
Searches all default system font paths and any font paths specified by the extraFontPaths parameter, and records data about all found fonts. |
void |
setFontProperties(Properties fontProperties)
Reads font data from the Properties file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int WEIGHT_BOLD
public static final int WEIGHT_NORMAL
| Constructor Detail |
public FontManager()
| Method Detail |
public static FontManager getInstance()
Returns a static instance of the FontManager class.
public Properties getFontProperties()
Gets a Properties object containing font information for the operating
system which the FontManager is running on. This Properties object
can be saved to disk and read at a later time using the setFontProperties(java.util.Properties)
method.
public void setFontProperties(Properties fontProperties)
throws IllegalArgumentException
Reads font data from the Properties file. All name and key data replaces any existing font information.
fontProperties - Properties object containing valid font information.
IllegalArgumentException - thrown, if there is a problem parsing the
Properties file. If thrown, the calling application should re-read
the system fonts.public void readSystemFonts(String[] extraFontPaths)
Searches all default system font paths and any font paths specified by the extraFontPaths parameter, and records data about all found fonts. This font data is used to substitute fonts which are not embedded inside a PDF document.
extraFontPaths - array String object where each entry represents
a system directory path containing font programs.public static String guessFamily(String name)
Utility method for guessing a font family name from its base name.
name - base name of font.
public static int guessWeight(String name)
Utility method for guessing the weight of a family.
name - base name of font.
public String[] getAvailableNames()
Gets all available font names on the operating system.
public String[] getAvailableFamilies()
Gets all available font family names on the operating system.
public String[] getAvailableStyle()
Gets all available font styles on the operating system.
public NFont getJapaneseInstance(String name,
int fontFlags)
public NFont getKoreanInstance(String name,
int fontFlags)
public NFont getChineseTraditionalInstance(String name,
int fontFlags)
public NFont getChineseSimplifiedInstance(String name,
int fontFlags)
public NFont getInstance(String name,
int flags)
Get an instance of a NFont from the given font name and flag decoration information.
name - base name of font.flags - flags used to describe font.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||