Link Search Menu Expand Document

AssemblyInfo-cs

This class contains all registered fonts.


SOLUTION

  • Thanks to Embedded Fonts we can make use of the fonts in the main project, with the Alias ​​property we can simplify or change the name of the font.

Monettelli Font Icons Structure Code Example

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]


#region FontIcons Embedded
// MATERIAL FONT ICONS
[assembly: ExportFont("materialdesignicons-webfont.ttf", Alias = "MaterialFontIcons")]
// CUSTOM FONT ICONS WITH "IconMoon" and "Fontello"
[assembly: ExportFont("monettelliuikitfonticons.ttf", Alias = "MonettelliFontIcons")]
#endregion


#region FontFamily Embedded
#region FONTFAMILY [SourceSansPro]
[assembly: ExportFont("SourceSansPro-Black.ttf", Alias = "SourceSansPro_Black")]
[assembly: ExportFont("SourceSansPro-BlackItalic.ttf", Alias = "SourceSansPro_BlackItalic")]
[assembly: ExportFont("SourceSansPro-Bold.ttf", Alias = "SourceSansPro_Bold")]
[assembly: ExportFont("SourceSansPro-BoldItalic.ttf", Alias = "SourceSansPro_BoldItalic")]
[assembly: ExportFont("SourceSansPro-ExtraLight.ttf", Alias = "SourceSansPro_ExtraLight")]
[assembly: ExportFont("SourceSansPro-ExtraLightItalic.ttf", Alias = "SourceSansPro_ExtraLightItalic")]

#endregion
#region FONTFAMILY [OpenSans]
// ...
#endregion
#region FONTFAMILY [Poppins]
// ...
#endregion
#region FONTFAMILY [BebasNeue]
// ...
#endregion
#endregion

Using Embedded Fonts in AssemblyInfo.cs Table

FontFamily StyleAlias
[FontFamily]-[Style].ttf[FontFamily]_[Style]
SourceSansPro-Black.ttfSourceSansPro_Black