fix width calc

This commit is contained in:
Sheikah 2023-01-21 00:42:22 +08:00
parent 12cf5fcd99
commit 5f59f9412a

View File

@ -123,7 +123,7 @@ uint16_t bmf_get_text_width(bmf_BitmapFont *font, uint8_t *text, uint32_t bytes_
} }
// get char width // get char width
if (unicode == bmf_ASCII_SPACE) { if (unicode == bmf_ASCII_SPACE) {
u8_char_size = u8_char_size / 2; // half width space u8_char_size = font->char_width / 2; // half width space
} else if (unicode == bmf_ASCII_T) { } else if (unicode == bmf_ASCII_T) {
u8_char_size = font->char_width * bmf_TAB_SIZE; u8_char_size = font->char_width * bmf_TAB_SIZE;
} else if (unicode == bmf_ASCII_R || unicode == bmf_ASCII_N) { } else if (unicode == bmf_ASCII_R || unicode == bmf_ASCII_N) {