Skip to content

ui::IconGlyph

Header: winui/render/IconGlyph.hpp.

One symbol-font glyph, the way every Fluent control draws its small marks (checkmark, chevron, overflow "more"): a codepoint, a font family and a default size.

A plain aggregate, so an app declares any glyph the glyphs:: table doesn't name. Draw one with draw_icon(); it converts implicitly to an IconSource for controls that take an icon.

Example:

const ui::Rect icon_rect{0, 0, 16, 16};
const ui::Rect chevron_rect{100, 0, 16, 16};

constexpr ui::IconGlyph ZoomIn{0xE8A3}; // Segoe Fluent Icons "ZoomIn", 12 DIPs
ui::draw_icon(renderer, ZoomIn, icon_rect, theme.palette.text_fill_primary);
ui::draw_icon(renderer, ui::glyphs::ChevronDown, chevron_rect, theme.colors().text, 0.0f,
              theme.icon_font_family); // the era's symbol font

Field Type Default
codepoint char32_t 0 A Segoe Fluent Icons codepoint, zero in a default-constructed glyph. Every glyph in glyphs:: sits in the Private Use Area (U+E000-U+F8FF) and fits one UTF-16 code unit. draw_icon() doesn't handle surrogate pairs.
font_family FontName "Segoe Fluent Icons" The symbol font.
size float 12.0f Default font size in DIPs, used when draw_icon() gets no size override.