Closed foreachthing closed 4 years ago
Hi @foreachthing,
As of now the lookup order is hard-coded, cf.:
We did not add the style-concept yet. That would probably a good extension. The way i would go about is to add style-property in xaml, e.g.
<fa:IconBlock Icon="Home" Foreground="Blue" Style="<Regular> or <Solid>" />
As a workaround you can always use the font explicitly in a TextBlock (see Readme) like this
<TextBlock Grid.Column="1" Text="" <----- Use hex-code of "IconChar.FolderOpen" here
FontFamily="/FontAwesome.Sharp;component/fonts/#Font Awesome 5 Free Solid"
Foreground="Chartreuse"
TextAlignment="Center" />
But of course then you lose most of the goodness FontAwesome.Sharp brings to the table ;-)
Thanks for your answer @mkoertgen I guess I should have mentioned that I am using Windows Forms (somehow I can't get used to wpf). Any chance of using solids with c#?
Hi @foreachthing,
You can always sub-class the component you want to use and override the FontFor-method.
For example the IconButton
:
public class MyIconButton : IconButton
{
public override FontFor(IconChar icon)
{
if (UseSolid)
return ....
}
}
As of now access to the internally loaded fonts is private/internal in FormsIconHelper.cs but it should be no problem to make this public.
Yeah ... ! I'm fairly new to c# and could not get it to work.
So, I adjusted the code according issue https://github.com/awesome-inc/FontAwesome.Sharp/issues/33, and that was it! :-)
Thanks for your patience and hard work.
How can I change the lookup-order of chars with the nuget package? I very much like the left char (solid) over the one on the right (regular):![image](https://user-images.githubusercontent.com/10420187/84143983-c90a6600-aa57-11ea-80dd-88abdc606984.png)