Class DrawFontManagerDefault

  • All Implemented Interfaces:
    DrawFontManager

    public class DrawFontManagerDefault
    extends Object
    implements DrawFontManager
    Manages fonts when rendering slides. Use this class to handle unknown / missing fonts or to substitute fonts
    • Constructor Detail

      • DrawFontManagerDefault

        public DrawFontManagerDefault()
    • Method Detail

      • getMappedFont

        public FontInfo getMappedFont​(Graphics2D graphics,
                                      FontInfo fontInfo)
        Description copied from interface: DrawFontManager
        select a font to be used to paint text
        Specified by:
        getMappedFont in interface DrawFontManager
        Parameters:
        graphics - the graphics context to request additional rendering hints
        fontInfo - the font info object corresponding to the text run font
        Returns:
        the font to be used to paint text
      • getFallbackFont

        public FontInfo getFallbackFont​(Graphics2D graphics,
                                        FontInfo fontInfo)
        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 interface DrawFontManager
        Parameters:
        graphics - the graphics context to request additional rendering hints
        fontInfo - the font info object corresponding to the text run font
        Returns:
        the font to be used as a fallback for the original typeface
      • 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 interface DrawFontManager
        Parameters:
        graphics - the graphics context to request additional rendering hints
        fontInfo - the font info object corresponding to the text run font
        fontSize - the font size in points
        bold - true if the font is bold
        italic - true if the font is italic
        Returns:
        the AWT font object