I am attempting to use font 'Segoe MDL2 Assets' glyphs in a c# WinUI desktop program. Microsoft docs specify this:
You can assign a value from the Symbol enumeration, or a Unicode string that references a glyph in the Segoe MDL2 Assets font. You can use the Character Map application that comes with Windows to browse the font's glyphs and find their Unicode values. Then, use the format "&#x/(UNICODE);" in XAML.
I selected the 'check mark' as a test: U+E001
<Button x:Name="buttonGlyph" ToolTipService.ToolTip="delete" BorderBrush="Transparent" >&#x/U+E001;</Button>
The line won't compile, I get the error 'Invalid character in hexadecimal character entity...'
Have I entered &#x/U+E001; incorrectly?
Thanks!
<Button>
<Button.Content>
<TextBlock FontFamily="Segoe MDL2 Assets"></TextBlock>
</Button.Content>
</Button>
Or a cleaner way:
<Button>
<Button.Content>
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/>
</Button.Content>
</Button>
I don't have the font to properly specify the name, so I guessed at it. If the font is installed on your system and you type the name correctly in the FontFamily
attribute, this should resolve.