matthewrdev / fa2cs Goto Github PK
View Code? Open in Web Editor NEWEasily use FontAwesome icon codes in C#.
License: MIT License
Easily use FontAwesome icon codes in C#.
License: MIT License
I made the same .cs file using https://andreinitescu.github.io/IconFont2Code/
So ... when I try to use it like so it does not work
MFractor knows what it is in the hover but ... no dice in the UI
Is my XAML off or ???
The fact that MFractor can show it tells me it's probably a Shell framework issue ?
Any direction you can offer would be appreciated ...
Hi @matthewrdev,
I want to know if there is a secondary file which only contains the free availble Icons, because currently also Icons which are only available in the Pro Version are in the file FontAwesomeIcons.cs
. The problem is that if you are using an icon which is only available in the Pro Version you will see Nothing withtin the app and don't get any error message.
So it would be great if there are two versions of the file one for the Free fonts and one for the Pro fonts.
Thanks.
I tried using it in XAML as your demo but it doesn't work (setting the text in code behind does work)
<Label Text="{x:Static fontAwesome:FontAwesomeIcons.AmazonPay}"/>
Using the FontAwesomeIcons.cs, I've had issues matching the glyphs to the fonts.
I recommend having separate classes for each font (solid, regular, brands).
That way, instead of:
<FontImageSource FontFamily="FARegular" Glyph="{x:Static fa:FontAwesomeIcons.AddressBook}" />
You can do:
<FontImageSource FontFamily="FARegular" Glyph="{x:Static fa:FontAwesomeRegular.AddressBook}" />
With the assistance of IntelliSense, having the font match the glyph class gives a clear indicator whether or not the icon exists in the selected font.
I've gone ahead and created these 3 classes for my own projects, please feel free to take them, and maybe pretty them up.
FontAwesomeBrands.cs
FontAwesomeRegular.cs
FontAwesomeSolid.cs
First, thanks for the great work on providing this simple class, it makes the XAML code much more readable.
In our projects we are leveraging the Microsoft.CodeAnalysis.FxCopAnalyzers in our projects. When I brought the FontAwesomeIcons.cs class into our project, the analyzers raised a warning:
warning CS0108: 'FontAwesomeIcons.Equals' hides inherited member 'object.Equals(object)'. Use the new keyword if hiding was intended.
To fix, I simply changed the Equals
string to Equal
(removing the trailing s
). Very minor issue, but would be nice to have this in the source instead of updating it on each iteration.
I'm interested in running this tool locally because I want to enhance the code generated by adding an attribute (that i've defined) for the supported fonts, updating the generated code to look something like:
[Description("arrow-right")]
[SupportedFonts(FontAwesome.Regular, ...)]
public const string ArrowRight = "\uf061";
[Description("apple")]
[SupportedFonts(FontAwesome.Brands)]
public const string Apple = "\uf179";
Looking at the tool, it requires an icons.json
file on the desktop. How do I acquire this file, is it something publicly available or is it private?
Thanks
Hi - Can you please create the v6.5.1
https://fontawesome.com/download
Is there a tool that generates this?
I have access to the FA 6.0 beta and would like to use the new icons.
I am willing to do the work and make a PR.
@matthewrdev I did figure out how to get duotone working using this, see: https://github.com/kfrancis/duotone-in-maui
Hi @matthewrdev
will be there an update for the v6.2.0 version?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.