Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 1.21 KB

ADD_FONT.md

File metadata and controls

30 lines (23 loc) · 1.21 KB

Adding a Custom Font

Android Bootstrap uses Typeface Icon Sets, which provide scalable graphics without the hassle of adding different drawable sizes for various screen densities. It should be possible to define your own icon sets by following the instructions below. Please send pull requests if you want an icon set added to the library by default.

Find the reference sheet for the typeface, and use a script to parse it. An example parsing script is currently available for the FontAwesome and Typicon typefaces. If possible, please also send a pull request for the script itself!

Create a class which implements the IconSet interface. This describes the location of the typeface in the assets directory, and the icon codes which map to unicode characters. See the default icon sets for examples.

Copy the typeface TTF file to the assets directory.

Initialise the custom typeface by calling TypefaceProvider.registerCustomIconSet().

Add icons to text using the BootstrapTextBuilder.

Test out the new icon set, send a pull request, or raise an issue if something isn't working.