FontIcons with glyph name instead of code
See original GitHub issueHello, is there any option to write the name of the glyph instead of the code? e.g.
<ui:FontIcon Glyph="" />
<ui:FontIcon Glyph="Edit" />
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Why does the Glyph not working in `FontIcon`?
I was trying another way of using it, I forget that I updated the code, however it doesn't work whether it's OTF or...
Read more >Using Glyphs | Font Awesome Docs
Open up your desktop design app and create a text box with the font set to Font Aweseome 6 Duotone, then paste in...
Read more >Use Glyphs | Font Awesome Docs
Since Font Awesome was released, we've supported copy and pasting glyphs of our icons into your favorite desktop apps. It's become the default...
Read more >Auto-generate static class for icon font glyphs · Issue #3811
When using a font icon it's most helpful to have a static class or other method to access the glyphs by name rather...
Read more >FontIcon does not Render Glyph that TextBlock Does #7003
I am only using two different Glyphs both in a TextBlock and a FontIcon. If the glyph in the font was bad it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
(I’m not sure) UWP has this same behaviour, see FontIcon.Glyph. (You may know) You’ll need to use SymbolIcon, it has a Symbol property which may suit your need (but it is limited)
Hey @daniel-rck, I’ve kinda found the solution. Basically you can Extend the FontIcon control to suit your need like this ⬇️
This FontIconEx control will parse and display every Symbol like the SymbolIcon control and also display Glyph Codes like the FontIcon control.
Thus you can do both
If the existing Symbols are not enough for you, you can create a new enum called SymbolEx with additional glyphs having custom names. Like this ⬇️
and change Symbol to SymbolEx in the GetGlyph and ConvertToString methods inside the FontIconEx class.
Edit :
Wait a minute, this doesn’t work when used outside the ModernWpf project.I created this code inside ModernWpf project and when I tried to do this in another project this code doesn’t work.I can’t even create a custom IconElement derivative, it says'IconElement.IconElement()' is inaccessible due to its protection level
Is this intentional @Kinnara?The code now works 👍