30 for (uint16_t i = 0; i <
HEIGHT; i += 8) {
31 for (uint16_t j = 0; j <
WIDTH; j++) {
32 uint8_t bits = glyph.
next();
37 for (uint8_t k = 0; k < 8; k++) {
39 if (bits & 1) canvas->
draw_pixel(x + j, y + k + i);
47 for (uint16_t i = 0; i <
HEIGHT; i += 8) {
48 for (uint16_t j = 0; j <
WIDTH; j++) {
49 uint8_t bits = glyph.
next();
50 for (uint8_t k = 0; k < 8; k++) {
52 if (bits & 1) canvas->
fill_rect(x + j*scale, y + (k+i)*scale, scale, scale);
60 #define ESCAPED_BITSET 0x1 65 unsigned char chr = c;
67 if (chr < m_font->
FIRST || chr > m_font->LAST) {
75 uint8_t uncompressed_size = m_font->WIDTH * ((m_font->HEIGHT + (
CHARBITS-1)) /
CHARBITS);
77 switch (m_font->m_compression_type)
80 m_bitmap = (uint8_t*)&m_font->m_bitmap[(chr - m_font->FIRST)*uncompressed_size];
84 uint16_t bitset_offset;
87 bitset_offset = pgm_read_byte(&m_font->m_bitmap[(chr - m_font->FIRST)*2]) << 8;
88 bitset_offset |= pgm_read_byte(&m_font->m_bitmap[(chr - m_font->FIRST)*2 + 1]);
90 if (bitset_offset & 0x8000) {
92 bitset_offset &= 0x7FFF;
94 m_bitset = (uint8_t*)&m_font->m_bitmap[bitset_offset];
119 switch (m_font->m_compression_type)
122 result = pgm_read_byte(&
m_bitmap[m_offset++]);
126 uint8_t bitset_offset = m_offset >> 3;
128 bitset_offset = (bitset_offset*2)+1;
129 uint8_t bitset_bit = 1 << (7 - (m_offset % 8));
134 if (pgm_read_byte(&m_bitset[bitset_offset]) & bitset_bit)
135 result = pgm_read_byte(&
m_bitmap[m_next++]);
virtual void fill_rect(uint16_t x, uint16_t y, uint16_t width, uint16_t height)
virtual void draw_vertical_line(uint16_t x, uint16_t y, uint16_t length)
virtual void draw(Canvas *canvas, char c, uint16_t x, uint16_t y, uint8_t scale)
virtual void draw_pixel(uint16_t x, uint16_t y)