summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2023-05-06 14:53:53 +0000
committerQMK Bot <hello@qmk.fm>2023-05-06 14:53:53 +0000
commit50e99864dd347805f805b123a18dfefd70010ad2 (patch)
tree77803762816d0a6a71c6fe1961d872768a478107 /quantum
parent25c4a480b1500f78756fbddc0854856fa7b42b56 (diff)
parent88780bf710a0f9a3a204d0feebac90755a2f3fff (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'quantum')
-rw-r--r--quantum/painter/qp_draw_text.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/quantum/painter/qp_draw_text.c b/quantum/painter/qp_draw_text.c
index ed3d373867..a70caac6f4 100644
--- a/quantum/painter/qp_draw_text.c
+++ b/quantum/painter/qp_draw_text.c
@@ -233,7 +233,7 @@ static inline bool qp_drawtext_prepare_glyph_for_render(qff_font_handle_t *qff_f
uint8_t glyph_width = (uint8_t)(glyph_info.value & QFF_GLYPH_WIDTH_MASK);
uint32_t glyph_offset = ((glyph_info.value & QFF_GLYPH_OFFSET_MASK) >> QFF_GLYPH_WIDTH_BITS);
uint32_t data_offset = sizeof(qff_font_descriptor_v1_t) // Skip the font descriptor
- + sizeof(qff_ascii_glyph_table_v1_t) // Skip the ascii table
+ + (qff_font->has_ascii_table ? sizeof(qff_ascii_glyph_table_v1_t) : 0) // Skip the ascii table
+ (qff_font->num_unicode_glyphs > 0 ? (sizeof(qff_unicode_glyph_table_v1_t) + (qff_font->num_unicode_glyphs * sizeof(qff_unicode_glyph_v1_t))) : 0) // Skip the unicode table
+ (qff_font->has_palette ? (sizeof(qgf_palette_v1_t) + ((1 << qff_font->bpp) * sizeof(qgf_palette_entry_v1_t))) : 0) // Skip the palette
+ sizeof(qgf_block_header_v1_t) // Skip the data block header
@@ -268,7 +268,7 @@ static inline bool qp_drawtext_prepare_glyph_for_render(qff_font_handle_t *qff_f
uint8_t glyph_width = (uint8_t)(glyph_info.value & QFF_GLYPH_WIDTH_MASK);
uint32_t glyph_offset = ((glyph_info.value & QFF_GLYPH_OFFSET_MASK) >> QFF_GLYPH_WIDTH_BITS);
uint32_t data_offset = sizeof(qff_font_descriptor_v1_t) // Skip the font descriptor
- + sizeof(qff_ascii_glyph_table_v1_t) // Skip the ascii table
+ + (qff_font->has_ascii_table ? sizeof(qff_ascii_glyph_table_v1_t) : 0) // Skip the ascii table
+ (qff_font->num_unicode_glyphs > 0 ? (sizeof(qff_unicode_glyph_table_v1_t) + (qff_font->num_unicode_glyphs * sizeof(qff_unicode_glyph_v1_t))) : 0) // Skip the unicode table
+ (qff_font->has_palette ? (sizeof(qgf_palette_v1_t) + ((1 << qff_font->bpp) * sizeof(qgf_palette_entry_v1_t))) : 0) // Skip the palette
+ sizeof(qgf_block_header_v1_t) // Skip the data block header