public final class FontUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EXCEPTION_MESSAGE_KEY_FONT_SET_FAMILY_NOT_FOUND |
static String |
EXCEPTION_MESSAGE_KEY_NULL_FONT |
Modifier and Type | Method and Description |
---|---|
void |
checkAwtFont(String name,
boolean ignoreMissingFont) |
protected void |
collectFontFamilyNames(Collection<String> names) |
protected void |
collectFontSetNames(Collection<String> names) |
static void |
copyNonNullOwnProperties(JRFont srcFont,
JRFont destFont) |
Map<AttributedCharacterIterator.Attribute,Object> |
getAttributesWithoutAwtFont(Map<AttributedCharacterIterator.Attribute,Object> attributes,
JRFont font) |
protected Font |
getAwtFont(FontInfo fontInfo,
int style,
float size,
boolean ignoreMissingFont) |
Font |
getAwtFont(JRFont font,
Locale locale)
Returns a java.awt.Font instance by converting a JRFont instance.
|
Font |
getAwtFontFromBundles(AwtFontAttribute fontAttribute,
int style,
float size,
Locale locale,
boolean ignoreMissingFont) |
Font |
getAwtFontFromBundles(boolean ignoreCase,
String name,
int style,
float size,
Locale locale,
boolean ignoreMissingFont) |
Font |
getAwtFontFromBundles(String name,
int style,
float size,
Locale locale,
boolean ignoreMissingFont)
Calls
getAwtFontFromBundles(boolean, String, int, float, Locale, boolean) with the ignoreCase parameter set to false. |
String |
getExportFontFamily(String name,
Locale locale,
String exporterKey) |
Collection<String> |
getFontFamilyNames()
Returns the font family names available through extensions, in alphabetical order.
|
FontInfo |
getFontInfo(String name,
boolean ignoreCase,
Locale locale)
Returns font information containing the font family, font face and font style.
|
FontInfo |
getFontInfo(String name,
Locale locale)
Returns font information containing the font family, font face and font style, searching for names case sensitive.
|
Collection<String> |
getFontNames()
Returns the font names available through extensions, in alphabetical order.
|
FontSetInfo |
getFontSetInfo(String name,
Locale locale,
boolean ignoreMissingFonts) |
static FontUtil |
getInstance(JasperReportsContext jasperReportsContext) |
void |
resetThreadMissingFontsCache() |
Font |
resolveDeserializedFont(Font font) |
public static final String EXCEPTION_MESSAGE_KEY_NULL_FONT
public static final String EXCEPTION_MESSAGE_KEY_FONT_SET_FAMILY_NOT_FOUND
public static FontUtil getInstance(JasperReportsContext jasperReportsContext)
public static void copyNonNullOwnProperties(JRFont srcFont, JRFont destFont)
public Map<AttributedCharacterIterator.Attribute,Object> getAttributesWithoutAwtFont(Map<AttributedCharacterIterator.Attribute,Object> attributes, JRFont font)
public FontInfo getFontInfo(String name, boolean ignoreCase, Locale locale)
name
- the font family or font face nameignoreCase
- the flag to specify if family names or face names are searched by ignoring case or notlocale
- the localepublic FontInfo getFontInfo(String name, Locale locale)
name
- the font family or font face namelocale
- the localepublic FontSetInfo getFontSetInfo(String name, Locale locale, boolean ignoreMissingFonts)
public String getExportFontFamily(String name, Locale locale, String exporterKey)
public Collection<String> getFontFamilyNames()
protected void collectFontFamilyNames(Collection<String> names)
public Collection<String> getFontNames()
protected void collectFontSetNames(Collection<String> names)
public Font getAwtFontFromBundles(String name, int style, float size, Locale locale, boolean ignoreMissingFont)
getAwtFontFromBundles(boolean, String, int, float, Locale, boolean)
with the ignoreCase parameter set to false.public Font getAwtFontFromBundles(boolean ignoreCase, String name, int style, float size, Locale locale, boolean ignoreMissingFont)
protected Font getAwtFont(FontInfo fontInfo, int style, float size, boolean ignoreMissingFont)
public Font getAwtFontFromBundles(AwtFontAttribute fontAttribute, int style, float size, Locale locale, boolean ignoreMissingFont)
public void resetThreadMissingFontsCache()
public void checkAwtFont(String name, boolean ignoreMissingFont)
public Font getAwtFont(JRFont font, Locale locale)
Copyright © 2023 Cloud Software Group, Inc.. All rights reserved.