public class PrismFontLoader extends FontLoader
| Modifier and Type | Field and Description |
|---|---|
private boolean |
embeddedFontsLoaded
Flag to keep track whether the fontCache map has been initialized with
the embedded fonts.
|
(package private) FontFactory |
installedFontFactory |
private static PrismFontLoader |
theInstance |
| Constructor and Description |
|---|
PrismFontLoader() |
| Modifier and Type | Method and Description |
|---|---|
float |
computeStringWidth(java.lang.String string,
Font font) |
private Font |
createFont(PGFont font) |
Font |
font(java.lang.String family,
FontWeight weight,
FontPosture posture,
float size)
Searches for an appropriate font based on the font family name and
weight and posture style.
|
java.util.List<java.lang.String> |
getFamilies()
Gets all the font families installed on the user's system, including any
embedded fonts or SDK fonts.
|
private FontFactory |
getFontFactoryFromPipeline() |
FontMetrics |
getFontMetrics(Font font) |
java.util.List<java.lang.String> |
getFontNames()
Gets the names of all fonts that are installed on the users system,
including any embedded fonts and SDK fonts.
|
java.util.List<java.lang.String> |
getFontNames(java.lang.String family)
Gets the names of all fonts in the specified font family that are
installed on the users system, including any embedded fonts and
SDK fonts.
|
static PrismFontLoader |
getInstance() |
float |
getSystemFontSize() |
(package private) java.util.Properties |
loadEmbeddedFontDefinitions() |
private void |
loadEmbeddedFonts() |
void |
loadFont(Font font) |
Font |
loadFont(java.io.InputStream in,
double size) |
Font |
loadFont(java.lang.String path,
double size) |
private static PrismFontLoader theInstance
private boolean embeddedFontsLoaded
FontFactory installedFontFactory
public static PrismFontLoader getInstance()
java.util.Properties loadEmbeddedFontDefinitions()
private void loadEmbeddedFonts()
public Font loadFont(java.io.InputStream in, double size)
loadFont in class FontLoaderpublic Font loadFont(java.lang.String path, double size)
loadFont in class FontLoaderpublic java.util.List<java.lang.String> getFamilies()
getFamilies in class FontLoaderpublic java.util.List<java.lang.String> getFontNames()
getFontNames in class FontLoaderpublic java.util.List<java.lang.String> getFontNames(java.lang.String family)
getFontNames in class FontLoaderpublic Font font(java.lang.String family, FontWeight weight, FontPosture posture, float size)
font in class FontLoaderfamily - The family of the fontweight - The weight of the fontposture - The posture or posture of the fontsize - The point size of the font. This can be a fractional valuepublic void loadFont(Font font)
loadFont in class FontLoaderfont - public FontMetrics getFontMetrics(Font font)
getFontMetrics in class FontLoaderpublic float computeStringWidth(java.lang.String string,
Font font)
computeStringWidth in class FontLoaderpublic float getSystemFontSize()
getSystemFontSize in class FontLoaderprivate FontFactory getFontFactoryFromPipeline()