Title here
Summary here
Fonts must be declared in Theme
. You could either declare them in your app.config.json
or in your application Theme
implementation (see theme).
{
"profile": {
"Theme": {
"fonts": {
"MyFont": {
"family": "MyFont",
"path": "path/to/Font.ttf"
},
"MyBoldItalicFont": {
"family": "MyFont",
"path": "path/to/FontBoldItalic.ttf",
"weight": 800,
"style": "italic"
},
"TajawalRegular": {
"family": "Tajawal",
"path": "path/to/Tajawal-Regular.ttf",
"baseline": "bottom",
"verticalAlign": "middle"
}
}
}
}
}
To ensure compatibility with various rendering engine :
family
should be the font family stored inside the font file. As a consequence, you will probably have multiple files for one family to manage bold, thin or italic use case. Family is mandatoryweight
should describe the weight (boldness) of the fonts. This should be a number from the following list :style
should describe the font style (normal, italic, oblique). Default value is “normal”baseline
is optional and should be used only for Lightning renderer when facing vertical alignment issue. Possible values are :verticalAlign
is optional and should be used only for Lightning renderer when facing vertical alignment issue. Possible values are :fontConfig
task by gruntBased on fonts declare in app.config.json
only.
This task get font metrics and store some configuration in generated/profile/config/fonts.json
:
heightRatio
is used to calculate the height of a font depending on size