update how newlines are handled

This commit is contained in:
Nishi 2026-04-27 04:04:04 +09:00
commit 21e2f2d599
Signed by: nishi
GPG key ID: 27EF69B208EB9343
4 changed files with 63 additions and 40 deletions

View file

@ -55,12 +55,6 @@ static int ft2_MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const c
if(l <= 0) break;
text += l;
if(c == '\n') {
x = 0;
y += ttf->face->height * ttf->px / ttf->face->units_per_EM;
continue;
}
ft_table.FT_Load_Char(ttf->face, c, FT_LOAD_RENDER);
bmp = &ttf->face->glyph->bitmap;
@ -86,11 +80,9 @@ static int ft2_MwDrawText(MwWidget handle, MwFLFont ttf, MwPoint* point, const c
old_text = text;
text += MwUTF8ToUTF32(text, &c2);
if(c2 != '\n') {
ft_table.FT_Get_Kerning(ttf->face, c, c2, FT_KERNING_DEFAULT, &vec);
ft_table.FT_Get_Kerning(ttf->face, c, c2, FT_KERNING_DEFAULT, &vec);
x += vec.x >> 6;
}
x += vec.x >> 6;
text = old_text;
}