Awesome Font For Mac

-->

Looking for Mac fonts? Click to find the best 66 free fonts in the Mac style. Every font is free to download! Font Awesome to PNG for Mac. Font Awesome to PNG for Mac. $2.99 Benjamin Vogelzang Mac OS X 10.7/10.8/10.9 Version 1.0.2 Full Specs. Visit Site External Download Site.

This article describes how Xamarin.Forms lets you specify font attributes (including weight and size) on controls that display text. Font information can be specified in code or specified in XAML. It's' also possible to use a custom font, and display font icons.

Set the font in code

Use the three font-related properties of any controls that display text:

  • FontFamily – the string font name.
  • FontSize – the font size as a double.
  • FontAttributes – a string specifying style information like Italic and Bold (using the FontAttributes enumeration in C#).
Font awesome icons for machine

This code shows how to create a label and specify the font size and weight to display:

Font size

The FontSize property can be set to a double value, for instance:

The size value is measured in device-independent units. For more information, see Units of Measurement.

Xamarin.Forms also defines fields in the NamedSize enumeration that represent specific font sizes. For more information about named font sizes, see Named font sizes.

Font attributes

Font styles such as bold and italic can be set on the FontAttributes property. The following values are currently supported:

  • None
  • Bold
  • Italic

The FontAttribute enumeration can be used as follows (you can specify a single attribute or OR them together):

Set font info per platform

Alternatively, the Device.RuntimePlatform property can be used to set different font names on each platform, as demonstrated in this code:

A good source of font information for iOS is iosfonts.com.

Set the font in XAML

Xamarin.Forms controls that display text all have a FontSize property that can be set in XAML. The simplest way to set the font in XAML is to use the named size enumeration values, as shown in this example:

There is a built-in converter for the FontSize property that allows all font settings to be expressed as a string value in XAML. In addition, the FontAttributes property can be used to specify font attributes:

The Device.RuntimePlatform property can also be used in XAML to render a different font on each platform. The example below uses different fonts on each platform:

Named font sizes

Xamarin.Forms defines fields in the NamedSize enumeration that represent specific font sizes. The following table shows the NamedSize members, and their default sizes on iOS, Android, and the Universal Windows Platform (UWP):

MemberiOSAndroidUWP
Default161414
Micro111015.667
Small131418.667
Medium161722.667
Large202232
Body171614
Header179646
Title282424
Subtitle221620
Caption121212

The size values are measured in device-independent units. For more information, see Units of Measurement.

Named font sizes can be set through both XAML and code. In addition, the Device.GetNamedSize method can be called to return a double that represents the named font size:

Note

On iOS and Android, named font sizes will autoscale based on operating system accessibility options. This behavior can be disabled on iOS with a platform-specific. For more information, see Accessibility Scaling for Named Font Sizes on iOS.

Use a custom font

Custom fonts can be added to your Xamarin.Forms shared project and consumed by platform projects without any additional work. The process for accomplishing this is as follows:

  1. Add the font to your Xamarin.Forms shared project as an embedded resource (Build Action: EmbeddedResource).
  2. Register the font file with the assembly, in a file such as AssemblyInfo.cs, using the ExportFont attribute. An optional alias can also be specified.

Important

Embedded fonts requires the use of Xamarin.Forms 4.5.0.530 or higher.

The following example shows the Lobster-Regular font being registered with the assembly, along with an alias:

Note

The font can reside in any folder in the shared project, without having to specify the folder name when registering the font with the assembly.

The font can then be consumed on each platform by referencing its name, without the file extension:

Alternatively, it can be consumed on each platform by referencing its alias:

The equivalent C# code is:

The following screenshots show the custom font:

Font

Important

On Windows, the font file name and font name may be different. To discover the font name on Windows, right-click the .ttf file and select Preview. The font name can then be determined from the preview window.

Display font icons

Font icons can be displayed by Xamarin.Forms applications by specifying the font icon data in a FontImageSource object. This class, which derives from the ImageSource class, has the following properties:

  • Glyph – the unicode character value of the font icon, specified as a string.
  • Size – a double value that indicates the size, in device-independent units, of the rendered font icon. The default value is 30. In addition, this property can be set to a named font size.
  • FontFamily – a string representing the font family to which the font icon belongs.
  • Color – an optional Color value to be used when displaying the font icon.

This data is used to create a PNG, which can be displayed by any view that can display an ImageSource. This approach permits font icons, such as emojis, to be displayed by multiple views, as opposed to limiting font icon display to a single text presenting view, such as a Label.

Important

Font icons can only currently be specified by their unicode character representation.

The following XAML example has a single font icon being displayed by an Image view:

This code displays an XBox icon, from the Ionicons font family, in an Image view. Note that while the unicode character for this icon is uf30c, it has to be escaped in XAML and so becomes . The equivalent C# code is:

The following screenshots, from the Bindable Layouts sample, show several font icons being displayed by a bindable layout:

Related links

Install fonts

Double-click the font in the Finder, then click Install Font in the font preview window that opens. After your Mac validates the font and opens the Font Book app, the font is installed and available for use.

You can use Font Book preferences to set the default install location, which determines whether the fonts you add are available to other user accounts on your Mac.

Fonts that appear dimmed in Font Book are either disabled ('Off'), or are additional fonts available for download from Apple. To download the font, select it and choose Edit > Download.

Disable fonts

You can disable any font that isn't required by your Mac. Select the font in Font Book, then choose Edit > Disable. The font remains installed, but no longer appears in the font menus of your apps. Fonts that are disabled show ”Off” next to the font name in Font Book.

Remove fonts

You can remove any font that isn't required by your Mac. Select the font in Font Book, then choose File > Remove. Font Book moves the font to the Trash.

Learn more

macOS supports TrueType (.ttf), Variable TrueType (.ttf), TrueType Collection (.ttc), OpenType (.otf), and OpenType Collection (.ttc) fonts. macOS Mojave adds support for OpenType-SVG fonts.

Font Design Mac

Legacy suitcase TrueType fonts and PostScript Type 1 LWFN fonts might work but aren't recommended.