Itage.FontIcon.LineAwesome
0.1.0
See the version list below for details.
dotnet add package Itage.FontIcon.LineAwesome --version 0.1.0
NuGet\Install-Package Itage.FontIcon.LineAwesome -Version 0.1.0
<PackageReference Include="Itage.FontIcon.LineAwesome" Version="0.1.0" />
paket add Itage.FontIcon.LineAwesome --version 0.1.0
#r "nuget: Itage.FontIcon.LineAwesome, 0.1.0"
// Install Itage.FontIcon.LineAwesome as a Cake Addin #addin nuget:?package=Itage.FontIcon.LineAwesome&version=0.1.0 // Install Itage.FontIcon.LineAwesome as a Cake Tool #tool nuget:?package=Itage.FontIcon.LineAwesome&version=0.1.0
Itage.FontIcon
A simplistic FontIcon control implementation for WPF/netcoreapp3.0.
This isn't actually a complete font icon library, it's rather a framework for building your own.
Example usage
Let's start with a simple font, called MyFont
, located in file myfont.ttf
containing a simple glyph with e900
.
Adding package reference
dotnet add package Itage.FontIcon
Embedding font into assebly.
Let's place font file into Resources\Fonts\myfont.ttf
and set its type to Resource
<ItemGroup>
<None Remove="Resources\Fonts\myfont.ttf" />
<Resource Include="Resources\Fonts\myfont.ttf" />
</ItemGroup>
Now it will be embedded into your executable or dll.
Making your own font icon
The icon control consists of two parts:
- Glyph
enum
- Control class
Now let's write some actual code:
public enum MyFontIconType
{
None = 0, // This is required
MyGlyph = 0xe900, // This is the code of our unicode character we want to embed
}
public class MyFontIcon : BaseFontIcon<MyFontIconType>
{
static MyFontIcon()
{
DefaultFontFamily = FontResourceHelper.MakeFontFamily(
typeof(MyFontIcon).Assembly, "resources/fonts", "MyFont");
}
public MyFontIcon()
{
FontFamily = DefaultFontFamily;
}
}
That's all!
Now you can use <ns:MyFontIcon Icon="MyGlyph">
in your views,
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 is compatible. netcoreapp3.1 was computed. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETCoreApp 3.0
- Itage.FontIcon (>= 0.1.0)
-
.NETFramework 4.5
- Itage.FontIcon (>= 0.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.