Cobalt Fonts generator
Today, we are proud to introduce our Cobalt Fonts generator to use them in your hybrid applications powered by Cobalt!
Font icons are the way to go on the Web for a few years now, because they are vectors, i.e. able to scale without aliasing, and avoid the designer to create a large amount of files.
Font icons in Native Bars
To use them, you had to use an existing or create your own native module, implementing the CobaltFont iOS protocol and inheriting the CobaltAbstractFontDrawable Android class, fill the glyphs dictionary (in the class itself on iOS, in a resource file on Android), import it to your native project, and register it in the cobalt.conf file.
The generator: fontToCobalt.py
But we faced a regular issue. Every time a font is added or updated, we had to create or update the corresponding files manually. So I developed a script for that!
It automates the packaging process of a font icon into an Android and/or iOS Cobalt Font module.
All you need is the TrueType file (.ttf) of the font and its corresponding reference.html file provided by IcoMoon or Fontastic (we will support a larger range of font generators later).
Then, just launch the script and simply import the generated packages into your Android and iOS Cobalt application projects.
python fontToCobalt.py --source fontastic --name myFont reference.html myFont.ttf
You can now use your new font in native bar actions and even your own native components!