Custom Font

From PowerUI
Jump to: navigation, search

Here's how to setup a custom font with PowerUI. Note that you can also use web fonts via @font-face too although we recommend including them in your project using this technique whenever possible. InfiniText, PowerUI's text engine, has full access to the glyphs in font faces and exposes the shapes publicly - if you want very advanced text effects then make sure you fiddle around with InfiniText too!

Adding a custom font

1. In any folder called Resources, create a folder with the font name you'd like to use.

 E.g. Resources/Verdana/

2. Put your font files in it.

 E.g. Resources/Verdana/Verdana Bold.ttf

3. Right click on the font folder, and go to PowerUI > Rename Font

   Or alternatively, just add .bytes to the end of those font files. This results in e.g. Resources/Verdana/Verdana Bold.ttf.bytes - a file which PowerUI can now easily read.

4. To use the font, use font-family:"Your Family name" in your CSS.

  E.g. font-family:"Verdana"