Module com.googlecode.lanterna
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 forSwingTerminal
that is extending fromAWTTerminalFontConfiguration
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.googlecode.lanterna.terminal.swing.AWTTerminalFontConfiguration
AWTTerminalFontConfiguration.BoldMode
-
-
Field Summary
-
Fields inherited from class com.googlecode.lanterna.terminal.swing.AWTTerminalFontConfiguration
DEFAULT_FONT_SIZE
-
-
Constructor Summary
Constructors Constructor Description SwingTerminalFontConfiguration(boolean useAntiAliasing, AWTTerminalFontConfiguration.BoldMode boldMode, java.awt.Font... fontsInOrderOfPriority)
Creates a new font configuration from a list of fonts in order of priority.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SwingTerminalFontConfiguration
getDefault()
This is the default font settings that will be used if you don't specify anythingstatic SwingTerminalFontConfiguration
getDefaultOfSize(int fontSize)
Returns the default font settings except for a custom font size to use.static SwingTerminalFontConfiguration
newInstance(java.awt.Font... fontsInOrderOfPriority)
Creates a new font configuration from a list of fonts in order of priority.-
Methods inherited from class com.googlecode.lanterna.terminal.swing.AWTTerminalFontConfiguration
filterMonospaced, getFontForCharacter, getFontHeight, getFontWidth, isAntiAliased, selectDefaultFont, selectDefaultFont
-
-
-
-
Constructor Detail
-
SwingTerminalFontConfiguration
public SwingTerminalFontConfiguration(boolean useAntiAliasing, AWTTerminalFontConfiguration.BoldMode boldMode, java.awt.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
- Iftrue
then anti-aliasing should be enabled when drawing textboldMode
- Option to control what to do when drawing text with the bold SGR enabledfontsInOrderOfPriority
- Fonts to use when drawing text, in order of priority
-
-
Method Detail
-
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(java.awt.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
-
-