Package org.apache.poi.sl.draw
Class DrawFontManagerDefault
- java.lang.Object
-
- org.apache.poi.sl.draw.DrawFontManagerDefault
-
- All Implemented Interfaces:
DrawFontManager
public class DrawFontManagerDefault extends java.lang.Object implements DrawFontManager
Manages fonts when rendering slides. Use this class to handle unknown / missing fonts or to substitute fonts
-
-
Constructor Summary
Constructors Constructor Description DrawFontManagerDefault()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.FontcreateAWTFont(java.awt.Graphics2D graphics, FontInfo fontInfo, double fontSize, boolean bold, boolean italic)Create an AWT font object with the given attributesFontInfogetFallbackFont(java.awt.Graphics2D graphics, FontInfo fontInfo)In case the original font doesn't contain a glyph, use the returned fallback font as an alternativeFontInfogetMappedFont(java.awt.Graphics2D graphics, FontInfo fontInfo)select a font to be used to paint textjava.lang.StringmapFontCharset(java.awt.Graphics2D graphics, FontInfo fontInfo, java.lang.String text)Map text charset depending on font family.
-
-
-
Method Detail
-
getMappedFont
public FontInfo getMappedFont(java.awt.Graphics2D graphics, FontInfo fontInfo)
Description copied from interface:DrawFontManagerselect a font to be used to paint text- Specified by:
getMappedFontin 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
public FontInfo getFallbackFont(java.awt.Graphics2D graphics, FontInfo fontInfo)
Description copied from interface:DrawFontManagerIn case the original font doesn't contain a glyph, use the returned fallback font as an alternative- Specified by:
getFallbackFontin 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
public java.lang.String mapFontCharset(java.awt.Graphics2D graphics, FontInfo fontInfo, java.lang.String text)Description copied from interface:DrawFontManagerMap text charset depending on font family.Currently this only maps for wingdings font (into unicode private use area)
- Specified by:
mapFontCharsetin 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:
- Drawing exotic fonts in a java applet,
StringUtil.mapMsCodepointString(String)
-
createAWTFont
public java.awt.Font createAWTFont(java.awt.Graphics2D graphics, FontInfo fontInfo, double fontSize, boolean bold, boolean italic)Description copied from interface:DrawFontManagerCreate an AWT font object with the given attributes- Specified by:
createAWTFontin 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-trueif the font is bolditalic-trueif the font is italic- Returns:
- the AWT font object
-
-