By dave | January 1, 2023

TcUnicode is a font format suitable for the presentation of a larger number of glyphs from different Unicode blocks. On most boards the size difference to Adafruit fonts is relatively insignificant. The advantage being that you can have fonts with glyphs from multiple unicode blocks efficiently.

TcUnicode rendering is also compatible with Adafruit fonts, so you can use both Adafruit_GFX and TcUnicode fonts at the same time with TcUnicodeHelper. For use within TcMenu, it is supported on all our graphical displays and is easily enabled in the display setup from the code generator dialog.

The library is fully backward compatible with AdafruitGFX fonts, and can interchange between them without any effort. In the examples we show both TcUnicode and Adafruit_GFX fonts being used in the same example. The TcUnicode format is quite similar to the Adafruit font format, so an understanding of that helps when understanding our format.

Internally the font is arranged as an array of unicode blocks, each block contains glyphs, usually in any font on an embedded device, there would be a limited number of blocks normally containing just enough for the job. Blocks are searched sequentially in reverse numeric order to find the right starting group. Once the right block is found, we then need to find the glyph, unlike Adafruit fonts, glyphs can be selected per item, which given than some ranges have over 30,000 items, with millions of possibilities, this is needed. To find a glyph we use a binary search algorithm, which provides fast access to the right glyph.

The bitmaps are stored within the block, and can be up to 64KB in size for each block, and the char-code is an offset to the block’s starting point, with up to 64K range allowed in each block. Bitmap format, offset parameters, and sizing is exactly as per AdafruitGFX (that’s why we can easily be backward compatible with a few lines of code). You can see more about this in the reference documentation linked below.

See for the reference documentation.

Other pages within this category

comments powered by Disqus

This site uses cookies to analyse traffic, and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.

Send a message

Please use the forum for help with UI & libraries.

This message will be securely transmitted to our servers.