From mcufont upstream: Fix tab handling in mf_get_string_width
This commit is contained in:
parent
99642e2a99
commit
db18904892
1 changed files with 11 additions and 0 deletions
|
@ -59,6 +59,17 @@ int16_t mf_get_string_width(const struct mf_font_s *font, mf_str text,
|
|||
{
|
||||
c2 = mf_getchar(&text);
|
||||
|
||||
if (c2 == '\t')
|
||||
{
|
||||
#if MF_USE_TABS
|
||||
result = mf_round_to_tab(font, 0, result);
|
||||
c1 = ' ';
|
||||
continue;
|
||||
#else
|
||||
c2 = ' ';
|
||||
#endif
|
||||
}
|
||||
|
||||
if (kern && c1 != 0)
|
||||
result += mf_compute_kerning(font, c1, c2);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue