Skip to content
ConsoleMonster
Class

SymbolFallback

ConsoleMonster.Glyphs

Namespace
ConsoleMonster.Glyphs
Assembly
ConsoleMonster
Modifiers
static

What emoji and special symbols become on glyph tiers that cannot show them: ✅ is √ on the Basic tier and [OK] on ASCII, ⚠️ is !, ❌ is × or x, ➜ is → or ->. Rendering also constrains caller text to the destination repertoire: ASCII is printable ASCII and Basic is WGL4, with ? for unsupported graphemes. The Full tier shows text as written. Apps add or change symbol entries with SymbolFallback.Register.

Inheritance

  • object
  • SymbolFallback

Methods

Apply 4 overloads
public static string Apply(string text, GlyphTier tier) #

Replaces complete emoji graphemes for a tier, including unknown emoji. Narrow replacements keep a separator before adjacent text. Existing whitespace is retained without adding a second separator.

Parameters

text string required
The text.
tier ConsoleMonster.Capabilities.GlyphTier required
The glyph tier.

Returns

string The text for that tier.
public static string Apply(string text, GlyphTier tier, TerminalWidthProfile widthProfile) #

Applies prose fallbacks using the destination's width model.

Parameters

text string required
The text.
tier ConsoleMonster.Capabilities.GlyphTier required
The glyph tier.
widthProfile ConsoleMonster.Text.TerminalWidthProfile required
The destination width model.

Returns

string The text with complete fallbacks and readable separators.
public static StyledText Apply(StyledText text, GlyphTier tier) #

Applies the fallback to every span of styled text.

Parameters

text ConsoleMonster.Text.StyledText required
The styled text.
tier ConsoleMonster.Capabilities.GlyphTier required
The glyph tier.

Returns

StyledText The text for that tier (the same instance when nothing changed).
public static StyledText Apply(StyledText text, GlyphTier tier, TerminalWidthProfile widthProfile) #

Applies fallbacks to styled text using the destination's width model, retaining unchanged span styles.

Parameters

text ConsoleMonster.Text.StyledText required
The styled text.
tier ConsoleMonster.Capabilities.GlyphTier required
The glyph tier.
widthProfile ConsoleMonster.Text.TerminalWidthProfile required
The destination width model.

Returns

StyledText The text for that tier.
public static string GetGlyph(string symbol, GlyphTier tier, TerminalWidthProfile? widthProfile = null) #

Returns a single-cell decorative fallback in Basic/ASCII, or the original symbol in Full. Unlike prose substitution, this never returns badges such as [OK] or [doc] and never truncates a token. Unknown reduced-tier symbols use *. Ordinary prose should use SymbolFallback.Apply.

Parameters

symbol string required
The emoji or symbol used as a cell glyph.
tier ConsoleMonster.Capabilities.GlyphTier required
The destination glyph tier.
widthProfile ConsoleMonster.Text.TerminalWidthProfile? = null optional
The destination width model, or the current model.

Returns

string A complete glyph; reduced-tier glyphs occupy exactly one destination cell.
public static string GetPrefix(string symbol, GlyphTier tier, TerminalWidthProfile? widthProfile = null) #

Returns a fixed-cell prefix with a separate trailing space. Basic/ASCII prefixes occupy two cells; Full prefixes reserve the emoji width plus one separator (at least three cells). No glyph is truncated.

Parameters

symbol string required
The emoji or symbol used as a prefix.
tier ConsoleMonster.Capabilities.GlyphTier required
The destination glyph tier.
widthProfile ConsoleMonster.Text.TerminalWidthProfile? = null optional
The destination width model, or the current model.

Returns

string The complete glyph padded to the prefix width.
public static void Register(string symbol, string basic, string ascii) #

Adds or replaces the fallback for a symbol.

Parameters

symbol string required
The symbol as written (an emoji with or without its variation selector).
basic string required
What the Basic tier shows.
ascii string required
What the ASCII tier shows.
public static bool TryGet(string symbol, GlyphTier tier, out string fallback) #

The fallback of a symbol for a tier.

Parameters

symbol string required
The symbol.
tier ConsoleMonster.Capabilities.GlyphTier required
The glyph tier.
fallback string required
The text to show instead (the symbol itself on the Full tier).

Returns

bool Whether the symbol has an entry.

Properties

public static bool Enabled { get; set; } #

Whether optional prose symbol substitution is applied (default true). Output still enforces the destination repertoire.