New icons available in sqUId

Material and Bootstrap icons added

After having support for Font Awesome icons for a long time now I also implemented support for Bootstrap and Material icons by using their otf font files. This brings a whole lot of new icons to sqUId:

  • Font Awesome: 675
  • Material: 2234
  • Bootstrap: 1953

That means right now there are 4862 icons available (plus the system included ones) from 3 font libraries for you to use easily.

New implementation of icon fonts

I also changed the way the icons are implemented into the system to make future additions of icon fonts very easy.

Basically for each icon font there is a pb file with the font included as binary data, a list of constants to use in code to access the icons and the functions to initialize the icons in your programs.

Those pb files can be generated using simple code that parses the css files of the font and processes the icon names and corresponding unicodes. Since the unicodes of the fonts can overlap, you are able to specify an offset that will be added for the generated constants and subtracted by the system, if you use such a constant in code, so that the correct icon is drawn on screen.

Example

The original code for the "file_earmark_fill" icon of the Bootstrap library is 62313. The offset is set to 100000 so the constant entry in the font pb file is set to 162313. When using the constant in code the real icon drawn is 162313-100000 which is the code 62313 again.

The constants for each icon are named by the following anming conventions: #UI_[font-short-name]_[icon-name]

So for example the "file_earmark_fill" icon of the Bootstrap library has the constant #UI_BS_file_earmark_fill, the "wifi_channel" icon of the Material library has the constant #UI_MA_wifi_channel.

Posts in this Series