Package org.apache.poi.sl.draw
Class DrawFontManagerDefault
java.lang.Object
org.apache.poi.sl.draw.DrawFontManagerDefault
- All Implemented Interfaces:
DrawFontManager
Manages fonts when rendering slides.
Use this class to handle unknown / missing fonts or to substitute fonts
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAWTFont
(Graphics2D graphics, FontInfo fontInfo, double fontSize, boolean bold, boolean italic) Create an AWT font object with the given attributesgetFallbackFont
(Graphics2D graphics, FontInfo fontInfo) In case the original font doesn't contain a glyph, use the returned fallback font as an alternativegetMappedFont
(Graphics2D graphics, FontInfo fontInfo) select a font to be used to paint textmapFontCharset
(Graphics2D graphics, FontInfo fontInfo, String text) Map text charset depending on font family.
-
Constructor Details
-
DrawFontManagerDefault
public DrawFontManagerDefault()
-
-
Method Details
-
getMappedFont
Description copied from interface:DrawFontManager
select a font to be used to paint text- Specified by:
getMappedFont
in interfaceDrawFontManager
- 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
Description copied from interface:DrawFontManager
In case the original font doesn't contain a glyph, use the returned fallback font as an alternative- Specified by:
getFallbackFont
in interfaceDrawFontManager
- 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
Description copied from interface:DrawFontManager
Map text charset depending on font family.Currently this only maps for wingdings font (into unicode private use area)
- Specified by:
mapFontCharset
in interfaceDrawFontManager
- 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:
-
createAWTFont
public Font createAWTFont(Graphics2D graphics, FontInfo fontInfo, double fontSize, boolean bold, boolean italic) Description copied from interface:DrawFontManager
Create an AWT font object with the given attributes- Specified by:
createAWTFont
in interfaceDrawFontManager
- Parameters:
graphics
- the graphics context to request additional rendering hintsfontInfo
- the font info object corresponding to the text run fontfontSize
- the font size in pointsbold
-true
if the font is bolditalic
-true
if the font is italic- Returns:
- the AWT font object
-