Support negative baseline_x in a font.
This commit is contained in:
parent
c41cbd05e9
commit
013bac84ce
@ -43,7 +43,7 @@ struct mf_font_s
|
|||||||
uint8_t max_x_advance;
|
uint8_t max_x_advance;
|
||||||
|
|
||||||
/* Location of the text baseline relative to character. */
|
/* Location of the text baseline relative to character. */
|
||||||
uint8_t baseline_x;
|
int8_t baseline_x;
|
||||||
uint8_t baseline_y;
|
uint8_t baseline_y;
|
||||||
|
|
||||||
/* Line height of the font (vertical advance). */
|
/* Line height of the font (vertical advance). */
|
||||||
|
@ -51,10 +51,8 @@ static bool get_wordlen(const struct mf_font_s *font, mf_str *text,
|
|||||||
{
|
{
|
||||||
result->chars++;
|
result->chars++;
|
||||||
|
|
||||||
if (c == ' ')
|
if (c == ' ' || c == '-')
|
||||||
result->space += mf_character_width(font, c);
|
result->space += mf_character_width(font, c);
|
||||||
else if (c == '-')
|
|
||||||
result->space += mf_character_width(font, '-');
|
|
||||||
else if (c == '\t')
|
else if (c == '\t')
|
||||||
result->space += mf_character_width(font, 'm') * MF_TABSIZE;
|
result->space += mf_character_width(font, 'm') * MF_TABSIZE;
|
||||||
else if (c == '\n') {
|
else if (c == '\n') {
|
||||||
|
Loading…
Reference in New Issue
Block a user