Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
interface Terminal

An interface for abstracting input and output for various terminal implementations.

Link copied to clipboard
class TerminalSize(val width: Int, val height: Int)

The size of the virtual terminal text area, where width and height represent the number of characters that can fit within it.

Link copied to clipboard

A class which provides text measurement utilities.

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard

Given width and height values, either create a new TerminalSize or re-use the same underlying object.

Link copied to clipboard

Iterator over the graphemes in a string, taking care to group Unicode clusters correctly.

Link copied to clipboard
fun TextMetrics.isEmoji(str: CharSequence, index: Int = 0): Boolean

Convenience version of isEmoji that works with raw strings instead of code points..

Link copied to clipboard
fun TextMetrics.renderWidthOf(str: CharSequence, startIndex: Int, endIndex: Int): Int

Convenience version of renderWidthOf using a form people are more used to for substrings.

Link copied to clipboard
fun TextMetrics.truncateToWidth(text: CharSequence, maxWidth: Int, truncateAt: TruncateAt = TruncateAt.END, ellipsis: String = EllipsisPresets.NONE): String

Take characters from text up until they can no longer fit into a space of maxWidth.