Comments (11)
Hi @Willy-Kimura, thanks for your interest,
If i understand correctly, you are suggesting some abstraction that allows for simple/dynamic switching between multiple Fonts/IconEnums including not only FontAwesome but also others like e.g. https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit.
Great idea! There would need to be some hook/abstraction that allows using a custom icon-enum & font, e.g. MaterialDesign, and enhancing it with the existing font/bitmap logic. Right now, i have not yet a good idea how to preserve the XAML-user experience because for this types need usually to be known at compile-time.
I would need to think a little about how to best fit this into the library. Meanwhile, if you have any ideas or suggestions on this let me know. If you have concrete implementation ideas, i would also love to accept a pull request on this.
from fontawesome.sharp.
Exactly my idea!
That's very much possible with the existing font/bitmap logic with the little/much I've gathered from the code base.
As of currently, I've implemented this type of feature by overriding a FontAwesome image/icon generator library and allowed library-switching right from a ComboBox control. However, it brought up quite some memory issues when rendering the icons at runtime and thus needs to be handled carefully for production. It's quite rusty at the moment but I can definitely give you the sources if need-be.
And even better is that a Material Icons Enumeration generation library is already provided as is FontAwesome by the same developer.
On the XAML-side, that's okay, we may be able to figure things out along the way. More checkup will need to be done on that. I'll try some few hits of my own and see how I can leverage on this feature and more. Hope to see some neat integrations on this.
Thanks a lot for your feedback.
from fontawesome.sharp.
Some other popular fonts to consider:
from fontawesome.sharp.
Added feature branch: https://github.com/awesome-inc/FontAwesome.Sharp/tree/materialicons.
Added console program for generating font enum classes from css files. Works for current FontAwesome & MaterialDesign.
from fontawesome.sharp.
@Willy-Kimura A memory issue with IconBlock
has recently been fixed by @ThomasMentzel, cf.: #12
I'm looking forward to having some spare time in the next few days and following up on this. 👍
from fontawesome.sharp.
@Willy-Kimura I quickly checked on extracting a base class for IconBlock
that supports using a custom font & icon-enum. I went for using the icon-enum as a generic type parameter which might seem a bit tricky. Next, i added a minimal example class using the MaterialDesign Icons font.
I did not expect the extracted dependency properties to work at all (because they are static), especially with xaml-markup. However, as far as i can tell it works surprisingly well.
I will follow up on generalizing the other wpf helpers as well. Then finally checking on the winforms part.
from fontawesome.sharp.
@mkoertgen Great great stuff... I followed up on the IconBlock
issue. Glad it was fixed before I did. That's really interesting for generic-type-params to work well on the icon enum...
Thanks a lot! I'll definitely check-up on your next commit for the made changes.
from fontawesome.sharp.
About to open a pull request.
Please note that instead of dynamically switching icon library at runtime we just made it easy & simple to use other icon fonts by
- adding a cli for generating an icon enum class
- extracting logic into a generic base classes that depend on icon enum & font
Also note that i only added an example for WPF since WinForms needs some extra effort. Is this ok for you?
Is the suggested example for material design ok for you? Or do you really need to switch icon fonts at runtime, i.e. use both fonts concurrently?
from fontawesome.sharp.
@Willy-Kimura Closed this for now. Feel free to reopen to continue discussion.
from fontawesome.sharp.
@mkoertgen Awesome work.
Just checked out the changes including the cli-class generation method.
If this method will allow me to embed various icon fonts at design-time, then probably I can find a way of switching them during design-time for the same purpose.
from fontawesome.sharp.
@Willy-Kimura You're welcome. You will probably need to add some abstraction on top since the types are fount-bound. 👍
from fontawesome.sharp.
Related Issues (20)
- FontAwesome.Sharp package (v5.15.4.0) is unsigned HOT 1
- Add example for nerdfonts
- Add Support for .NET 7, C# 11
- Evaluate https://thenounproject.com/icons/
- Update NuGet Package to 6.2.1 HOT 3
- CVE-2022-34716 (Medium) detected in system.security.cryptography.xml.4.7.0.nupkg
- WS-2022-0161 (High) detected in newtonsoft.json.12.0.3.nupkg, nuke.common.6.1.1.nupkg
- Generate FontAwesome.Sharp.dll for FA Pro? HOT 13
- Image and text are not horizontal aligned. HOT 1
- Update NuGet package FontAwesome.Sharp.Pro HOT 2
- Update NuGet package FontAwesome.Sharp.Pro HOT 6
- CVE-2022-26907 (Medium) detected in microsoft.rest.clientruntime.2.3.20.nupkg, nuke.common.6.1.1.nupkg
- CVE-2023-29337 (High) detected in nuget.common.5.11.0.nupkg, nuke.common.6.1.1.nupkg
- CVE-2024-21907 (High) detected in newtonsoft.json.12.0.3.nupkg, nuke.common.6.1.1.nupkg
- System.ArgumentException: '' is not a valid value for property 'FontFamily' HOT 7
- Font Awesome Sharp Pro DuoToneIcons Support HOT 1
- Support / Add example for Open Iconic HOT 1
- Duplicate IconChar entries in property window. HOT 8
- Button content not properly aligned. HOT 6
- How to use with Awesome Pro? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fontawesome.sharp.