Font library instructions
Inclusion font
- Feather: This font covers commonly used tool icons, such as arrows, settings icons, etc.
- Material: This font matches the Google Material design specifications and provides more than a thousand icons
- Brands: Covers most company logos on the world
Preview
- Enter the project, find the required font (
.ttf
) in the Assets folder, and use Character Map App after installation to open it. - Enter the project, open the
demo.html
file in the corresponding font folder in the Demo folder, and preview it locally.
Usage
nuget:Richasy.Font.UWP
Icon class
Three types of IconElement
were created in the project, namely FeatherIcon
, MaterialIcon
and BrandIcon
, which correspond to the three fonts above.
The icon class inherits from FontIcon
, FontFamily has been set by default, and also provides the Symbol
enumeration dependent property, which is convenient for you to select icons in a more friendly way (relative to input characters).
Xaml
<NavigationViewItem Content="Activity">
<NavigationViewItem.Icon>
<font:FeatherIcon Symbol="Activity"/>
</NavigationViewItem.Icon>
</NavigationViewItem>
C#
var icon = new FeatherIcon(FeatherSymbol.Activity);
C# - Get character from symbol
string icon = ((char)icon).ToString();
System font class
Here mainly uses CanvasFontSet
to get the current system font, filtering out the icon font and possible garbled font
Usage
var fonts = SystemFont.GetSystemFonts();
foreach (var font in fonts)
{
string name = font.Name;
Debug.WriteLine(name);
}
Precautions
In order to comply with the grammar, I made some modifications to the icon's name, the rules are as follows:
- Remove the prefix of
icon-
- Remove the
-
,_
and other connectors, the naming method is Pascal - If the first character is a number (such as
360
), a_
will be added at the front