PanelDue font header format change proposal
-
Current header:
extern const uint8_t glcd28x32[] =
{
28, // character width in pixels
32, // row height in pixels
3, // space columns between characters before kerning
0x20, // first character code
0xFF, // last character codeProposal:
extern const uint8_t glcd28x32[] =
{
28, // character width in pixels
32, // row height in pixels
3, // space columns between characters before kerning
2, // character ranges (1-255)
0x20, 0x00, // first character code (16-bit little-endian value, range 1)
0xFF, 0x00, // last character code (16-bit little-endian value, range 1)
0x10, 0x04, // first character code (16-bit little-endian value, range 2)
0x4F, 0x04, // last character code (16-bit little-endian value, range 2)Offset of first character is (number of ranges)*4 + 4.
The goal of this proposal is to enable more locales (cyrillic, eastern, etc) but save flash memory by not including complete unicode fonts, only certain ranges
-
That looks good to me. When you add new characters, make sure they come from open source fonts.
-
Proof-of-concept implementation of non-continuous unicode fonts for PanelDue. In this patch I added Russian alphabet (Unicode characters from 1040 (0x0410) to 1103 (0x044F)) to the glcd28x32 font. I used the same Liberation Sans font (Windows size 22) and it looks great. I replaced Control button label with first and last chars from second font range and it works okay.
Firmware size is still acceptable (~101kb) so I can make a full Russian locale now.
-
Any ideas how to place more locale labels on screen? There is a room for 4 locales, what if I want to add 5th or 6th?
-
Can you have the locale button open a scrollable dialog box (like we have for selecting g-code files)? that way you can have as many locales as you like.