113 int scan_x1, scan_y1, scan_width, scan_height;
114 while (text[i] !=
'\0') {
116 int glyph_n = this->
match_next_glyph((
const uint8_t *) text + i, &match_length);
119 ESP_LOGW(TAG,
"Encountered character without representation in font: '%c'", text[i]);
121 uint8_t glyph_width = this->
get_glyphs()[0].glyph_data_->advance;
131 glyph.
scan_area(&scan_x1, &scan_y1, &scan_width, &scan_height);
134 const int max_x = x_at + scan_x1 + scan_width;
135 const int max_y = y_start + scan_y1 + scan_height;
138 uint8_t pixel_data = 0;
139 uint8_t bpp_max = (1 << this->
bpp_) - 1;
140 auto diff_r = (float) color.
r - (
float) background.
r;
141 auto diff_g = (float) color.
g - (
float) background.
g;
142 auto diff_b = (float) color.
b - (
float) background.
b;
143 auto diff_w = (float) color.
w - (
float) background.
w;
144 auto b_r = (float) background.
r;
145 auto b_g = (float) background.
g;
146 auto b_b = (float) background.
b;
147 auto b_w = (float) background.
w;
148 for (
int glyph_y = y_start + scan_y1; glyph_y != max_y; glyph_y++) {
149 for (
int glyph_x = x_at + scan_x1; glyph_x != max_x; glyph_x++) {
151 for (
int bit_num = 0; bit_num != this->
bpp_; bit_num++) {
157 if ((pixel_data & bitmask) != 0)
161 if (pixel == bpp_max) {
163 }
else if (pixel != 0) {
164 auto on = (float) pixel / (
float) bpp_max;
165 auto blended =
Color((uint8_t) (diff_r * on + b_r), (uint8_t) (diff_g * on + b_g),
166 (uint8_t) (diff_b * on + b_b), (uint8_t) (diff_w * on + b_w));