Package jexer.backend

Class GlyphMaker


  • public class GlyphMaker
    extends java.lang.Object
    GlyphMaker presents unified interface to all of its supported fonts to clients.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canDisplay​(int codePoint)
      Checks if a fallback font has a glyph for the specified character.
      java.awt.image.BufferedImage getImage​(Cell cell, int cellWidth, int cellHeight, Backend backend)
      Get a glyph image.
      java.awt.image.BufferedImage getImage​(Cell cell, int cellWidth, int cellHeight, Backend backend, boolean blinkVisible)
      Get a glyph image.
      static GlyphMaker getInstance​(int fontSize)
      Obtain the GlyphMaker instance for a particular font size.
      boolean isCjk()
      Check if a CJK font is available.
      boolean isEmoji()
      Check if an emoji font is available.
      boolean isFallback()
      Check if a fallback font is available.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static GlyphMaker getInstance​(int fontSize)
        Obtain the GlyphMaker instance for a particular font size.
        Parameters:
        fontSize - the size of these fonts in pixels
        Returns:
        the instance
      • getImage

        public java.awt.image.BufferedImage getImage​(Cell cell,
                                                     int cellWidth,
                                                     int cellHeight,
                                                     Backend backend)
        Get a glyph image.
        Parameters:
        cell - the character to draw
        cellWidth - the width of the text cell to draw into
        cellHeight - the height of the text cell to draw into
        backend - the backend that can obtain the correct background color
        Returns:
        the glyph as an image
      • getImage

        public java.awt.image.BufferedImage getImage​(Cell cell,
                                                     int cellWidth,
                                                     int cellHeight,
                                                     Backend backend,
                                                     boolean blinkVisible)
        Get a glyph image.
        Parameters:
        cell - the character to draw
        cellWidth - the width of the text cell to draw into
        cellHeight - the height of the text cell to draw into
        backend - the backend that can obtain the correct background color
        blinkVisible - if true, the cell is visible if it is blinking
        Returns:
        the glyph as an image
      • isCjk

        public boolean isCjk()
        Check if a CJK font is available.
        Returns:
        true if a CJK font is available
      • isEmoji

        public boolean isEmoji()
        Check if an emoji font is available.
        Returns:
        true if an emoji font is available
      • isFallback

        public boolean isFallback()
        Check if a fallback font is available.
        Returns:
        true if a fallback font is available
      • canDisplay

        public boolean canDisplay​(int codePoint)
        Checks if a fallback font has a glyph for the specified character.
        Parameters:
        codePoint - the character (Unicode code point) for which a glyph is needed.
        Returns:
        true if this Font has a glyph for the character; false otherwise.