Overview¶
Principle¶
The Font Engine is composed of:
- A “Font Designer” module: a graphical tool which runs within the MicroEJ IDE used to build and edit MicroUI fonts; it stores fonts in a platform-independent format. See Font Designer.
- A “Font Generator” module, for converting fonts from the platform-independent format into a platform-dependent format.
- The “Font Renderer” module which decodes and renders at application runtime the platform-dependent fonts files generated by the “Font Generator”.
The three modules are complementary: a MicroUI font must be created and edited with the Font Designer before being integrated as a resource by the Font Generator. Finally the Font Renderer uses the generated fonts at runtime.
Functional Description¶
Font Generation¶
Process overview:
- User uses the Font Designer module to create a new font, and imports
characters from system fonts (
*.ttf
files) and / or user images (*.png
,*.jpg
,*.bmp
, etc.). - Font Designer module saves the font as a MicroEJ Font (
*.ejf
file). - The user defines, in a text file, the fonts to load.
- The Font Generator outputs a raw file for each font to convert (the raw format is display device-dependent).
- The raw files are embedded as (hidden) resources within the MicroEJ Application. The raw files’ data are linked into the FLASH memory.
- When the application creates a MicroUI Font object which targets a pre-generated image, the Font Engine Core only has to link from the MicroUI Font object to the data in the FLASH memory. Therefore, the loading is very fast; only the font data from the FLASH memory is used: no copy of the font data is sent to RAM memory first.