Info
- Icons as font glyphs (Material Symbols) instead of sprites. Code in
Utils/FontSymbols
- Sharp at any size, color like text, swap by state or visual preset
Usage
FontSymbolTMPTextUI - a TextMeshProUGUI that shows one icon glyph. Set Font Symbol = FontSymbol(definition, char) with the picker
- Font size follows the rect:
min(width, height) × Scale. Size the rect, not the font
- Wrapping, rich text and auto size are turned off for you
FontSymbolTMPText - world space version (TextMeshPro), same sizing from the rect. Material Preset picks a material of the font atlas (URP Lit / Unlit)
FontSymbolText - the same for legacy Text
FontSymbolsDefinition - SO with CodepointsAsset (from a .codepoints file), Font and TMP_FontAsset. Picker window with search
- Material Symbols in the content kit
UI/FontSymbols/: MaterialSymbols_Round_Filled (default for app icons), MaterialSymbols_Round_Standard
- Switch icon by state:
FontSymbolTMPTextUISymbolPreset (state preset), FontSymbolVisualID (visual presets)


Gotchas
- The TMP fonts are dynamic: a missing glyph is added to the atlas at runtime (
FontSymbolAvailability tells if it can be)
- Icon texts don't need
LocalizeFont, only texts driven by a string event do, see Localization
- Inside layout groups give the icon a fixed
LayoutElement, it sizes from its rect
- Don't put icon glyphs into plain TMP texts relying on font fallback