

Alternatively, all fonts in the app can be registered by using a wildcard in your project file: įonts can also be added to other folders of your app project. This creates a corresponding entry in your project file. In the example above, the first argument to the AddFont method is the font filename, while the second argument represents an optional alias by which the font can be referenced when consuming it.Ī font can be added to your app project by dragging it into the Resources\Fonts folder of the project, where its build action will automatically be set to MauiFont. Then, on the IFontCollection object, call the AddFont method to add the required font to your app: namespace MyMauiAppįonts.AddFont("Lobster-Regular.ttf", "Lobster") This is accomplished by invoking the ConfigureFonts method on the MauiAppBuilder object.
#Interarchy font size registration#
True type format (TTF) and open type font (OTF) fonts can be added to your app and referenced by filename or alias, with registration being performed in the CreateMauiApp method in the MauiProgram class. These properties are backed by BindableProperty objects, which means that they can be targets of data bindings, and styled.Īll controls that display text automatically use font scaling, which means that an app's UI reflects text scaling preferences set in the operating system. The default value of this property is true.

NET Multi-platform App UI (.NET MAUI) apps use the Open Sans font on each platform.
