The EVE Asset Builder can be used to convert your chosen font into large characters. You can convert only the numerical characters to save space. Here is one way to do it.
Prepare the font character set:
- Obtain the font file (.ttf or .otf) for the desired font.
- Open the Windows Character Map and select the desired font (the font must be installed in Windows).
- Select the characters to be converted.
- Copy the characters, paste into Notepad, and save the file as UTF-8. (Figure 3b)
Note: We have chosen characters which are continuous in the ANSI character set so that the converted font can be used directly with EVE’s CMD_TEXT and CMD_NUMBER.
Convert the font:
- Open EVE Asset Builder and go to the Font Converter tab (Figure 3c).
- For Input Font, select your .ttf or .otf file.
- For Input Character, select your UTF-8 character text file.
- Here we selected the size as 90, and set the EVE command to CMD_SETFONT2.
- We set ‘First Character’ to 43 to match the first character ‘+’ in our chosen character set.
- Click Convert and once complete, go to the output folder.
- In this example we selected L1, L2, L4 and L8 formats which are converted into output folders of the same name.
- Copy the .raw or the .rawh file (which is a text readable version of the .raw file) for your chosen format into your MCU project as a data array.
Note: L8 offers 8 bits of colour depth but larger data size, whilst L1 offers 1 bit colour depth and smaller data size. In this case, we chose the L2 data which offers 2-bits per pixel.
The final display is shown in Figure 3d. The code to set up and use your new font is very simple, as shown below Figure 3.
You can save even more MCU Flash space by compressing the font data. Stay tuned, we’ll show you how to do this in a future FAQ. You can however contact us at support.emea@brtchip.comfor any further information on using custom fonts in your application with EVE…”
Here is the full list of commands for the example shown in Figure 3d.
Contact us at support.emea@brtchip.com if you would like an EVE Screen Editor (ESE) project which demonstrates this technique.