AsciiFont class abstract

Abstract base class for ASCII art fonts.

To create a custom font, extend this class and implement glyphs and height. Optionally override letterSpacing for custom spacing.

Example:

class MyCustomFont extends AsciiFont {
  const MyCustomFont();

  @override
  int get height => 3;

  @override
  Map<String, AsciiGlyph> get glyphs => {
    'A': AsciiGlyph([' /\\ ', '/  \\', '----']),
    // ... more glyphs
  };
}

Constructors

AsciiFont()
const

Properties

glyphs Map<String, AsciiGlyph>
Map of characters to their ASCII art representations.
no setter
hashCode int
The hash code for this object.
no setterinherited
height int
The height in lines of glyphs in this font.
no setter
letterSpacing int
The spacing between letters in characters.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getGlyph(String char) AsciiGlyph
Get the glyph for a character, or a fallback if not found.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

Banner-style font with larger characters (7 lines high).
block → const AsciiFont
Block/shadow style font (6 lines high).
slim → const AsciiFont
Slim/thin style font (5 lines high).
standard → const AsciiFont
Standard block-style ASCII font (5 lines high).