Fontawesome 6不在。 – >查看https://*gi*thu*b.com/martintopfstedt/fontawesome6
FontAwesome5
WPF(.NET和.NET CORE)和UWP/WINUI控件,用于标志性SVG,字体和CSS Toolkit Font Awesome 5。
字体很棒:https://github.com/fortawesome/font-awesome
- 当前版本:v5.15.4
入门
安装
安装FontAwesome5 nuget软件包: Install-Package FontAwesome5或安装FontAwesome5 Install-Package FontAwesome5 .WinUI
用法XAML
用法与Charri的版本相同,仅Fontawesomeicon枚举已更改为Efontawesomeicon,并具有包括样式,这意味着“ flag”更改为“ solid_flag”或“ lundric_flag”,并且名称空间从“ http://schemas.fonta*w*som*e.io”更改为“
https://gi**thub.*com/charri/font-awesome-wpf/blob/master/readme-wpf.md#usage-xaml
用法XAML SVG
svgawesome可以像成像行动一样使用。
FontAwesome5.WPF.Example\”
xmlns=\”http://schemas.*mi*croso*ft.com/winfx/2006/xaml/presentation\”
xmlns:x=\”http://schemas.micro*s**oft.com/winfx/2006/xaml\”
xmlns:fa5=\”http://schemas.fo*n*tawe*some.com/icons/\”
Title=\” FontAwesome5 .WPF.Example\” Height=\”300\” Width=\”300\”>
<Grid Margin=\”20\”>
<fa5:SvgAwesome Icon=\”Solid_Flag\” VerticalAlignment=\”Center\” HorizontalAlignment=\”Center\” />
</Grid>
</Window>\”>
<Window x:Class=\" FontAwesome5 .WPF.Example\"
xmlns=\"http://schemas.*mi*croso*ft.com/winfx/2006/xaml/presentation\"
xmlns:x=\"http://schemas.micro*s**oft.com/winfx/2006/xaml\"
xmlns:fa5=\"http://schemas.fo*n*tawe*some.com/icons/\"
Title=\" FontAwesome5 .WPF.Example\" Height=\"300\" Width=\"300\">
<Grid Margin=\"20\">
<fa5:SvgAwesome Icon=\"Solid_Flag\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Center\" />
</Grid>
</Window>
转换器(仅WPF)
ImageSourCeconverter
https://gi*thu*b.co*m/charri/font-awesome-wpf/blob/master/readme-wpf.md#imagesourceconverter
ImageSourcesVgConverter
这与ImageSourCoconverter一样,除非它确实使用SVG信息来绘制图标而不是字体。
标签会员
获取efontaweshicon的标签/名称。转换器参数可以包含格式字符串,其中{0}是标签/名称,{1}是样式。
例子:
FontAwesome5.WPF.Example\”
xmlns=\”http://schemas.*mi*croso*ft.com/winfx/2006/xaml/presentation\”
xmlns:x=\”http://schemas.micro*s**oft.com/winfx/2006/xaml\”
xmlns:fa5=\”http://schemas.fo*n*tawe*some.com/icons/\”
Title=\” FontAwesome5 .WPF.Example\” Height=\”300\” Width=\”300\”>
<Window.Resources>
<fa5:LabelConverter x:Key=\”LabelConverter\”/>
</Window.Resources>
<Grid Margin=\”20\”>
<TextBlock Text=\”{Binding EFontAwesomeIcon, Converter={StaticResource LabelConverter}}\”/>
<TextBlock Text=\”{Binding EFontAwesomeIcon, Converter={StaticResource LabelConverter}, ConverterParameter=\'{}{0} ({1})\’}\”/>
</Grid>
</Window>\”>
<Window x:Class=\" FontAwesome5 .WPF.Example\"
xmlns=\"http://schemas.*mi*croso*ft.com/winfx/2006/xaml/presentation\"
xmlns:x=\"http://schemas.micro*s**oft.com/winfx/2006/xaml\"
xmlns:fa5=\"http://schemas.fo*n*tawe*some.com/icons/\"
Title=\" FontAwesome5 .WPF.Example\" Height=\"300\" Width=\"300\">
<Window.Resources>
<fa5:LabelConverter x:Key=\"LabelConverter\"/>
</Window.Resources>
<Grid Margin=\"20\">
<TextBlock Text=\"{Binding EFontAwesomeIcon, Converter={StaticResource LabelConverter}}\"/>
<TextBlock Text=\"{Binding EFontAwesomeIcon, Converter={StaticResource LabelConverter}, ConverterParameter=\'{}{0} ({1})\'}\"/>
</Grid>
</Window>
StyleConverter
获取Efontaweshicon的Efontawesomestele。
例子:
FontAwesome5.WPF.Example\”
xmlns=\”http://schemas.*mi*croso*ft.com/winfx/2006/xaml/presentation\”
xmlns:x=\”http://schemas.micro*s**oft.com/winfx/2006/xaml\”
xmlns:fa5=\”http://schemas.fo*n*tawe*some.com/icons/\”
Title=\” FontAwesome5 .WPF.Example\” Height=\”300\” Width=\”300\”>
<Window.Resources>
<fa5:StyleConverter x:Key=\”StyleConverter\”/>
</Window.Resources>
<Grid Margin=\”20\”>
<TextBlock Text=\”{Binding EFontAwesomeIcon, Converter={StaticResource StyleConverter}}\”/>
</Grid>
</Window>\”>
<Window x:Class=\" FontAwesome5 .WPF.Example\"
xmlns=\"http://schemas.*mi*croso*ft.com/winfx/2006/xaml/presentation\"
xmlns:x=\"http://schemas.micro*s**oft.com/winfx/2006/xaml\"
xmlns:fa5=\"http://schemas.fo*n*tawe*some.com/icons/\"
Title=\" FontAwesome5 .WPF.Example\" Height=\"300\" Width=\"300\">
<Window.Resources>
<fa5:StyleConverter x:Key=\"StyleConverter\"/>
</Window.Resources>
<Grid Margin=\"20\">
<TextBlock Text=\"{Binding EFontAwesomeIcon, Converter={StaticResource StyleConverter}}\"/>
</Grid>
</Window>
学分
- @davegandy:https://github.com/fortawesome/font-awesome
- @charri:https://github.com/charri/font-awesome-wpf
