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