public class PrismFontLoader extends FontLoader
Constructor and Description |
---|
PrismFontLoader() |
Modifier and Type | Method and Description |
---|---|
float |
computeStringWidth(String string,
Font font) |
Font |
font(String family,
FontWeight weight,
FontPosture posture,
float size)
Searches for an appropriate font based on the font family name and
weight and posture style.
|
List<String> |
getFamilies()
Gets all the font families installed on the user's system, including any
embedded fonts or SDK fonts.
|
FontMetrics |
getFontMetrics(Font font) |
List<String> |
getFontNames()
Gets the names of all fonts that are installed on the users system,
including any embedded fonts and SDK fonts.
|
List<String> |
getFontNames(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() |
void |
loadFont(Font font) |
Font |
loadFont(InputStream in,
double size) |
Font |
loadFont(String path,
double size) |
public static PrismFontLoader getInstance()
public Font loadFont(InputStream in, double size)
loadFont
in class FontLoader
public Font loadFont(String path, double size)
loadFont
in class FontLoader
public List<String> getFamilies()
getFamilies
in class FontLoader
public List<String> getFontNames()
getFontNames
in class FontLoader
public List<String> getFontNames(String family)
getFontNames
in class FontLoader
public Font font(String family, FontWeight weight, FontPosture posture, float size)
font
in class FontLoader
family
- 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 FontLoader
font
- public FontMetrics getFontMetrics(Font font)
getFontMetrics
in class FontLoader
public float computeStringWidth(String string, Font font)
computeStringWidth
in class FontLoader
public float getSystemFontSize()
getSystemFontSize
in class FontLoader
Copyright © 2020. All rights reserved.