|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.core.pobjects.fonts.FontManager
public class 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.
| Constructor Summary | |
|---|---|
FontManager()
|
|
| Method Summary | |
|---|---|
void |
clearFontList()
Clears internal font list of items. |
java.lang.String[] |
getAvailableFamilies()
Gets all available font family names on the operating system. |
java.lang.String[] |
getAvailableNames()
Gets all available font names on the operating system. |
java.lang.String[] |
getAvailableStyle()
Gets all available font styles on the operating system. |
FontFile |
getChineseSimplifiedInstance(java.lang.String name,
int fontFlags)
|
FontFile |
getChineseTraditionalInstance(java.lang.String name,
int fontFlags)
|
java.util.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. |
FontFile |
getInstance(java.lang.String name,
int flags)
Get an instance of a NFont from the given font name and flag decoration information. |
FontFile |
getJapaneseInstance(java.lang.String name,
int fontFlags)
|
FontFile |
getKoreanInstance(java.lang.String name,
int fontFlags)
|
java.awt.Font |
getType1AWTFont(java.lang.String fontName,
int fontSize)
Gets a Font instance by matching against font style commonalities in the of know type1 fonts |
static java.lang.String |
guessFamily(java.lang.String name)
Utility method for guessing a font family name from its base name. |
void |
readFontPackage(java.lang.String fontResourcePackage,
java.util.List<java.lang.String> resources)
Reads the specified resources from the specified package. |
void |
readSystemFonts(java.lang.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(java.util.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 |
| Constructor Detail |
|---|
public FontManager()
| Method Detail |
|---|
public static FontManager getInstance()
Returns a static instance of the FontManager class.
public java.util.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(java.util.Properties fontProperties)
throws java.lang.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.
java.lang.IllegalArgumentException - thrown, if there is a problem parsing the
Properties file. If thrown, the calling application should re-read
the system fonts.public void clearFontList()
public void readSystemFonts(java.lang.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 java.lang.String guessFamily(java.lang.String name)
Utility method for guessing a font family name from its base name.
name - base name of font.
public java.lang.String[] getAvailableNames()
Gets all available font names on the operating system.
public java.lang.String[] getAvailableFamilies()
Gets all available font family names on the operating system.
public java.lang.String[] getAvailableStyle()
Gets all available font styles on the operating system.
public FontFile getJapaneseInstance(java.lang.String name,
int fontFlags)
public FontFile getKoreanInstance(java.lang.String name,
int fontFlags)
public FontFile getChineseTraditionalInstance(java.lang.String name,
int fontFlags)
public FontFile getChineseSimplifiedInstance(java.lang.String name,
int fontFlags)
public void readFontPackage(java.lang.String fontResourcePackage,
java.util.List<java.lang.String> resources)
fontResourcePackage - package to look for the resources in.resources - file names of font resources to load.
public FontFile getInstance(java.lang.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.
public java.awt.Font getType1AWTFont(java.lang.String fontName,
int fontSize)
fontName - font name to search for
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||