Module com.googlecode.lanterna
Class SwingTerminalFontConfiguration
java.lang.Object
com.googlecode.lanterna.terminal.swing.AWTTerminalFontConfiguration
com.googlecode.lanterna.terminal.swing.SwingTerminalFontConfiguration
Font configuration class for
SwingTerminal
that is extending from AWTTerminalFontConfiguration
-
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
ConstructorsConstructorDescriptionSwingTerminalFontConfiguration
(boolean useAntiAliasing, AWTTerminalFontConfiguration.BoldMode boldMode, Font... fontsInOrderOfPriority) Creates a new font configuration from a list of fonts in order of priority. -
Method Summary
Modifier and TypeMethodDescriptionThis is the default font settings that will be used if you don't specify anythinggetDefaultOfSize
(int fontSize) Returns the default font settings except for a custom font size to use.newInstance
(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 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
- 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 Details
-
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
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
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
-