It turns out that it is quite easy to use custom fonts in an App Studio project. This is useful if you need a specialized font (not one of the official 13) or want to give your app a unique look. Here’s a step by step guide:
- Put the font file in your project directory. It should be in .ttf format.
- Drag it from there into your Project Explorer
- Add this line to extraheaders in Project CSS:
@font-face {font-family: sansation; src: url('Sansation_Light.ttf');}
4. Set the fontfamily of your controls to the name of your font face. In this case, it would be ‘sansation’.
That’s it!
(See the CustomFont sample in folder 2 to try it out.)