Skip to content

Commit

Permalink
Fix scaling issue for C2D_Text with font info
Browse files Browse the repository at this point in the history
  • Loading branch information
piepie62 authored and fincs committed Jan 13, 2022
1 parent 242584a commit 614bd5d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/text.c
Expand Up @@ -321,18 +321,19 @@ void C2D_DrawText(const C2D_Text* text, u32 flags, float x, float y, float z, fl
C2Di_Glyph* cur;
CFNT_s* systemFont = fontGetSystemFont();

scaleX *= s_textScale;
scaleY *= s_textScale;

float glyphZ = z;
float glyphH;
float dispY;
if (text->font)
{
scaleX *= text->font->textScale;
scaleY *= text->font->textScale;
glyphH = scaleY*text->font->cfnt->finf.tglp->cellHeight;
dispY = ceilf(scaleY*text->font->cfnt->finf.lineFeed);
} else
{
scaleX *= s_textScale;
scaleY *= s_textScale;
glyphH = scaleY*fontGetGlyphInfo(systemFont)->cellHeight;
dispY = ceilf(scaleY*fontGetInfo(systemFont)->lineFeed);
}
Expand Down

0 comments on commit 614bd5d

Please sign in to comment.