Package org.apache.poi.sl.draw
Interface DrawFontManager
-
- All Known Implementing Classes:
DrawFontManagerDefault
public interface DrawFontManager
Manages fonts when rendering slides. Use this class to handle unknown / missing fonts or to substitute fonts
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Font
createAWTFont(Graphics2D graphics, FontInfo fontInfo, double size, boolean bold, boolean italic)
Create an AWT font object with the given attributesFontInfo
getFallbackFont(Graphics2D graphics, FontInfo fontInfo)
In case the original font doesn't contain a glyph, use the returned fallback font as an alternativeFontInfo
getMappedFont(Graphics2D graphics, FontInfo fontInfo)
select a font to be used to paint textString
mapFontCharset(Graphics2D graphics, FontInfo fontInfo, String text)
Map text charset depending on font family.
-
-
-
Method Detail
-
getMappedFont
FontInfo getMappedFont(Graphics2D graphics, FontInfo fontInfo)
select a font to be used to paint text- Parameters:
graphics
- the graphics context to request additional rendering hintsfontInfo
- the font info object corresponding to the text run font- Returns:
- the font to be used to paint text
-
getFallbackFont
FontInfo getFallbackFont(Graphics2D graphics, FontInfo fontInfo)
In case the original font doesn't contain a glyph, use the returned fallback font as an alternative- Parameters:
graphics
- the graphics context to request additional rendering hintsfontInfo
- the font info object corresponding to the text run font- Returns:
- the font to be used as a fallback for the original typeface
-
mapFontCharset
String mapFontCharset(Graphics2D graphics, FontInfo fontInfo, String text)
Map text charset depending on font family.Currently this only maps for wingdings and symbol font (into unicode private use area)
Depending if the requested font is installed in the system, tbe mapped string varies:
If the font is registered into the graphics environment the characters are mapped to the private use area. If the font is missing (and hence a AWT logical font is used), the characters are mapped to the corresponding unicode characters- Parameters:
graphics
- the graphics context to request additional rendering hintsfontInfo
- the font info object corresponding to the text run fonttext
- the raw text- Returns:
- String with mapped codepoints
- See Also:
StringUtil.mapMsCodepointString(String)
-
createAWTFont
Font createAWTFont(Graphics2D graphics, FontInfo fontInfo, double size, boolean bold, boolean italic)
Create an AWT font object with the given attributes- Parameters:
graphics
- the graphics context to request additional rendering hintsfontInfo
- the font info object corresponding to the text run fontsize
- the font size in pointsbold
-true
if the font is bolditalic
-true
if the font is italic- Returns:
- the AWT font object
-
-