CharMap - Megatokio/kilipili GitHub Wiki

CharMap<> and SimpleCharMap

These are the two supported character-based backing stores for display using a FrameBuffer<>.
They are displayed using a FrameBuffer<> . They can be printed at with their very basic print functions or using a Printer<>.

class SimpleCharMap

header file Graphics/SimpleCharMap.h

This class provides a pure 1-byte-per-character text array. The foreground and background color can be set and that's it. You can use one of the ascii fonts which have a bold or inverse copy of the character set in the upper half of the font and this way at least have one highlight possibility.


template class CharMap<>

header file Graphics/CharMap.h

This class provides a 2-byte-per-character array where each character is accompanied by an attribute byte. The template arguments define how this byte is used:

CharMap\<fgbit,bgbits,bold,underline,graphics>;

  • fgbits: number of bits for index in foreground color table
  • bgbits: number of bits for index in background color table
  • bold: enable support for attribute bold
  • underline: enable support for attribute underline
  • graphics: enable support for attribute font2 which by default is the graphics font

Since this all must fit in a byte the total number of bits must not exceed 8.

The color tables are dimensioned appropriately and can be set by the program. Initially only fgcolor[0] and bgcolor[0] are set, so that you see anything when you display the CharMap with a FrameBuffer<>.

⚠️ **GitHub.com Fallback** ⚠️