mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-12 01:08:32 +03:00
fnl: Fix reported width of tab character
The reported size of the tab character seems to be roughly 2.88x the size of the glyph in the font. This fixes a text layout issue with the commander info (HP, Job, etc).
This commit is contained in:
+4
-1
@@ -312,7 +312,10 @@ static float _fnl_size_char(struct fnl_render_size *size, uint16_t code)
|
||||
return 0.0;
|
||||
if (!size->bitmap->face->glyphs[index].data_pos)
|
||||
return 0.0;
|
||||
return (float)size->bitmap->face->glyphs[index].real_width / (float)size->denominator;
|
||||
float r = (float)size->bitmap->face->glyphs[index].real_width / (float)size->denominator;
|
||||
if (code == '\t')
|
||||
r *= 2.88;
|
||||
return r;
|
||||
}
|
||||
|
||||
float fnl_size_char(struct text_style *ts, uint16_t code)
|
||||
|
||||
Reference in New Issue
Block a user