Package org.jline.terminal.impl
Class DoubleSizeCharacters
java.lang.Object
org.jline.terminal.impl.DoubleSizeCharacters
Utility class for handling double-size characters in terminals.
Double-size characters are a feature supported by some terminals that allows displaying text at double width and/or double height. This is useful for creating banners, headers, or emphasizing important text.
The implementation uses VT100-compatible escape sequences: - ESC # 3: Double-height, double-width line (top half) - ESC # 4: Double-height, double-width line (bottom half) - ESC # 5: Single-width, single-height line (normal) - ESC # 6: Double-width, single-height line
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of double-size character modes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisDoubleSizeSupported(Terminal terminal) Checks if the terminal supports double-size characters.static voidprintBanner(Terminal terminal, String text, char borderChar) Creates a banner with the specified text using double-height characters.static voidprintDoubleHeight(Terminal terminal, String text) Prints text in double height (both top and bottom halves).static voidprintDoubleWidth(Terminal terminal, String text) Prints text in double width.static voidprintNormal(Terminal terminal, String text) Prints text in normal size.static voidResets the terminal to normal character size.static voidsetMode(Terminal terminal, DoubleSizeCharacters.Mode mode) Sets the double-size character mode for the current line.
-
Constructor Details
-
DoubleSizeCharacters
public DoubleSizeCharacters()Creates a new DoubleSizeCharacters instance.
-
-
Method Details
-
isDoubleSizeSupported
Checks if the terminal supports double-size characters.- Parameters:
terminal- the terminal to check- Returns:
- true if the terminal supports double-size characters, false otherwise
-
setMode
Sets the double-size character mode for the current line.- Parameters:
terminal- the terminal to write tomode- the double-size mode to set- Throws:
IOException- if an I/O error occurs
-
printNormal
Prints text in normal size.- Parameters:
terminal- the terminal to write totext- the text to print- Throws:
IOException- if an I/O error occurs
-
printDoubleWidth
Prints text in double width.- Parameters:
terminal- the terminal to write totext- the text to print- Throws:
IOException- if an I/O error occurs
-
printDoubleHeight
Prints text in double height (both top and bottom halves). This method automatically handles printing both the top and bottom halves of double-height text.- Parameters:
terminal- the terminal to write totext- the text to print- Throws:
IOException- if an I/O error occurs
-
printBanner
Creates a banner with the specified text using double-height characters. This is useful for creating prominent headers or titles.- Parameters:
terminal- the terminal to write totext- the text for the bannerborderChar- the character to use for the border (e.g., '*', '=', '-')- Throws:
IOException- if an I/O error occurs
-
reset
Resets the terminal to normal character size. This is useful to ensure the terminal is in a known state.- Parameters:
terminal- the terminal to reset- Throws:
IOException- if an I/O error occurs
-