// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. namespace Microsoft.Terminal.UI { /// /// Categorizes the type of a single grapheme cluster or input text. /// Used to determine how the input should be handled or rendered (for example, /// whether it should be treated as an emoji, an icon from a symbol font, plain text, etc.). /// enum FontIconGlyphKind { /// /// Input is invalid or contains more than one grapheme cluster and therefore cannot be /// treated as a single symbol. Typical for multi-character text like file paths /// or composed strings that include separators. /// Invalid = -1, /// /// No grapheme present (empty string). Indicates absence of a symbol. /// None = 0, /// /// A single emoji grapheme cluster. This may consist of multiple Unicode code /// points combined into one visible glyph (e.g., emoji with modifiers or ZWJ sequences). /// Emoji = 1, /// /// A single glyph from the Segoe Fluent Icons / MDL2 Assets Private Use Area (PUA), /// typically in the Unicode range U+E700–U+F8FF. These are font-based icons (Fluent/MDL2). /// FluentSymbol = 2, /// /// A single non-emoji grapheme that is not a Fluent/MDL2 PUA symbol. /// Covers ordinary characters, letters, numbers, or other single glyph symbols. /// Other = 3, }; /// /// Static utility class for text and icon analysis /// static runtimeclass FontIconGlyphClassifier { /// /// Determines if text represents a single grapheme cluster (emoji/symbol icon). /// Uses ICU for Unicode boundary detection to distinguish icons from file paths. /// /// Text to analyze /// True if single grapheme cluster, false for multi-character text or paths static Boolean IsLikelyToBeEmojiOrSymbolIcon(String text); /// /// Classifies the input into a glyph kind suitable for icon or text rendering. /// static FontIconGlyphKind Classify(String text); }; }