Skip to content

Commit 614bd5d

Browse files
piepie62fincs
authored andcommitted
Fix scaling issue for C2D_Text with font info
1 parent 242584a commit 614bd5d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

source/text.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,18 +321,19 @@ void C2D_DrawText(const C2D_Text* text, u32 flags, float x, float y, float z, fl
321321
C2Di_Glyph* cur;
322322
CFNT_s* systemFont = fontGetSystemFont();
323323

324-
scaleX *= s_textScale;
325-
scaleY *= s_textScale;
326-
327324
float glyphZ = z;
328325
float glyphH;
329326
float dispY;
330327
if (text->font)
331328
{
329+
scaleX *= text->font->textScale;
330+
scaleY *= text->font->textScale;
332331
glyphH = scaleY*text->font->cfnt->finf.tglp->cellHeight;
333332
dispY = ceilf(scaleY*text->font->cfnt->finf.lineFeed);
334333
} else
335334
{
335+
scaleX *= s_textScale;
336+
scaleY *= s_textScale;
336337
glyphH = scaleY*fontGetGlyphInfo(systemFont)->cellHeight;
337338
dispY = ceilf(scaleY*fontGetInfo(systemFont)->lineFeed);
338339
}

0 commit comments

Comments
 (0)