106 int scan_x1, scan_y1, scan_width, scan_height;
107 while (text[i] !=
'\0') {
109 int glyph_n = this->
match_next_glyph((
const uint8_t *) text + i, &match_length);
112 ESP_LOGW(TAG,
"Encountered character without representation in font: '%c'", text[i]);
114 uint8_t glyph_width = this->
get_glyphs()[0].glyph_data_->advance;
124 glyph.
scan_area(&scan_x1, &scan_y1, &scan_width, &scan_height);
127 const int max_x = x_at + scan_x1 + scan_width;
128 const int max_y = y_start + scan_y1 + scan_height;
131 uint8_t pixel_data = 0;
132 uint8_t bpp_max = (1 << this->
bpp_) - 1;
133 auto diff_r = (float) color.
r - (
float) background.
r;
134 auto diff_g = (float) color.
g - (
float) background.
g;
135 auto diff_b = (float) color.
b - (
float) background.
b;
136 auto diff_w = (float) color.
w - (
float) background.
w;
137 auto b_r = (float) background.
r;
138 auto b_g = (float) background.
g;
139 auto b_b = (float) background.
b;
140 auto b_w = (float) background.
w;
141 for (
int glyph_y = y_start + scan_y1; glyph_y != max_y; glyph_y++) {
142 for (
int glyph_x = x_at + scan_x1; glyph_x != max_x; glyph_x++) {
144 for (
int bit_num = 0; bit_num != this->
bpp_; bit_num++) {
150 if ((pixel_data & bitmask) != 0)
154 if (pixel == bpp_max) {
156 }
else if (pixel != 0) {
157 auto on = (float) pixel / (
float) bpp_max;
158 auto blended =
Color((uint8_t) (diff_r * on + b_r), (uint8_t) (diff_g * on + b_g),
159 (uint8_t) (diff_b * on + b_b), (uint8_t) (diff_w * on + b_w));