Class SwingTerminalFontConfiguration

java.lang.Object
com.googlecode.lanterna.terminal.swing.AWTTerminalFontConfiguration
com.googlecode.lanterna.terminal.swing.SwingTerminalFontConfiguration

public class SwingTerminalFontConfiguration extends AWTTerminalFontConfiguration
Font configuration class for SwingTerminal that is extending from AWTTerminalFontConfiguration
  • Constructor Details

    • SwingTerminalFontConfiguration

      public SwingTerminalFontConfiguration(boolean useAntiAliasing, AWTTerminalFontConfiguration.BoldMode boldMode, Font... fontsInOrderOfPriority)
      Creates a new font configuration from a list of fonts in order of priority. This works by having the terminal attempt to draw each character with the fonts in the order they are specified in and stop once we find a font that can actually draw the character. For ASCII characters, it's very likely that the first font will always be used.
      Parameters:
      useAntiAliasing - If true then anti-aliasing should be enabled when drawing text
      boldMode - Option to control what to do when drawing text with the bold SGR enabled
      fontsInOrderOfPriority - Fonts to use when drawing text, in order of priority
  • Method Details

    • getDefault

      public static SwingTerminalFontConfiguration getDefault()
      This is the default font settings that will be used if you don't specify anything
      Returns:
      A SwingTerminal font configuration object with default values set up
    • getDefaultOfSize

      public static SwingTerminalFontConfiguration getDefaultOfSize(int fontSize)
      Returns the default font settings except for a custom font size to use.
      Parameters:
      fontSize - Size of the font
      Returns:
      An SwingTerminal font configuration object with default values set up
    • newInstance

      public static SwingTerminalFontConfiguration newInstance(Font... fontsInOrderOfPriority)
      Creates a new font configuration from a list of fonts in order of priority. This works by having the terminal attempt to draw each character with the fonts in the order they are specified in and stop once we find a font that can actually draw the character. For ASCII characters, it's very likely that the first font will always be used.
      Parameters:
      fontsInOrderOfPriority - Fonts to use when drawing text, in order of priority
      Returns:
      Font configuration built from the font list