The icons in the user interface are based on the qtawesome library but there has been the need to extend the provided additional custom icons.
Icons are provided to the code via a Singleton object icon.py. in the openlp.core.ui package.
There is a mapping between the code tag for the icon and the actual icon implementation name provided by qtawesome.
Any icon extensions are also loaded and managed by this class. This has allowed us to create our own icons.
In openlp.core.ui.fonts directory there is a file called openlp.std. This contains the icon images, it is a clone of qtawesome to allow some examples to be available, only the Openlp fonts are loaded from here.
This file is best edited using FontForge.
Inside the file, there are slots for the individual icon images and the openlp custom ones are on the first page.
FontForge will also allow this file to be compiled to openlp.tff which is used at run time and resides in the same directory. the icon.py code loads this file are startup.
To map between an individual font in the tff file and the application code, a record needs to be added to openlp-charmap.json. This file and the tff file are used by qtawesome to load the fonts and allow the code to have access to them.
Qtawesome loads its fonts under the fa handle.
OpenLP loads its fonts under the op handle.
This means it is obvious in the code where a font comes from.
In addition to mapping icons, it is possible to amend a number of attributes. The array of icon mappings in the code allows this to happen.
If an icon is defined but not found, a default icon is provided so the code will load and work, you will just get a red cross.