SymbolFallback
ConsoleMonster.Glyphs
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
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
- The text.
- tier ConsoleMonster.Capabilities.GlyphTier
- 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
- The text.
- tier ConsoleMonster.Capabilities.GlyphTier
- The glyph tier.
- widthProfile ConsoleMonster.Text.TerminalWidthProfile
- 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
- The styled text.
- tier ConsoleMonster.Capabilities.GlyphTier
- The glyph tier.
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
- The styled text.
- tier ConsoleMonster.Capabilities.GlyphTier
- The glyph tier.
- widthProfile ConsoleMonster.Text.TerminalWidthProfile
- The destination width model.
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
- The emoji or symbol used as a cell glyph.
- tier ConsoleMonster.Capabilities.GlyphTier
- The destination glyph tier.
- widthProfile ConsoleMonster.Text.TerminalWidthProfile? = null
- 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
- The emoji or symbol used as a prefix.
- tier ConsoleMonster.Capabilities.GlyphTier
- The destination glyph tier.
- widthProfile ConsoleMonster.Text.TerminalWidthProfile? = null
- 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
- The symbol as written (an emoji with or without its variation selector).
- basic string
- What the Basic tier shows.
- ascii string
- 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
- The symbol.
- tier ConsoleMonster.Capabilities.GlyphTier
- The glyph tier.
- fallback string
- The text to show instead (the symbol itself on the Full tier).
Returns
bool Whether the symbol has an entry.Inherited Methods
Properties
public static bool Enabled { get; set; } #Whether optional prose symbol substitution is applied (default true). Output still enforces the destination repertoire.