diff options
author | Diegoisawesome <Diegoisawesome@users.noreply.github.com> | 2018-07-15 04:43:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-15 04:43:03 -0700 |
commit | 07ef76277021d5cddf14004e37e785c31fcea69b (patch) | |
tree | 2ddbc42ed88d41986a5db903ddb06ac5bbed0df3 /src/text.c | |
parent | 24f6484643ed3d7115fd4ebd92f254f224f1ca97 (diff) | |
parent | 731d6d59bc624e0350b3396f135a35f6c9bdc4f8 (diff) |
Merge pull request #275 from Diegoisawesome/master
Document list_menu.c and main_menu.c
Diffstat (limited to 'src/text.c')
-rw-r--r-- | src/text.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/text.c b/src/text.c index f7c68f549..0fc00c9b9 100644 --- a/src/text.c +++ b/src/text.c @@ -3157,7 +3157,7 @@ u32 GetStringWidthFixedWidthFont(const u8 *str, u8 fontId, u8 letterSpacing) width = lineWidths[strPos]; } - return (u8)(GetFontAttribute(fontId, 0) + letterSpacing) * width; + return (u8)(GetFontAttribute(fontId, FONTATTR_MAX_LETTER_WIDTH) + letterSpacing) * width; } u32 (*GetFontWidthFunc(u8 glyphId))(u16, bool32) @@ -3193,7 +3193,7 @@ u32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) return 0; if (letterSpacing == -1) - localLetterSpacing = GetFontAttribute(fontId, 2); + localLetterSpacing = GetFontAttribute(fontId, FONTATTR_LETTER_SPACING); else localLetterSpacing = letterSpacing; @@ -3269,7 +3269,7 @@ u32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) if (func == NULL) return 0; if (letterSpacing == -1) - localLetterSpacing = GetFontAttribute(*str, 2); + localLetterSpacing = GetFontAttribute(*str, FONTATTR_LETTER_SPACING); break; case 0x11: glyphWidth = *++str; @@ -3497,28 +3497,28 @@ u8 GetFontAttribute(u8 fontId, u8 attributeId) int result = 0; switch (attributeId) { - case 0: + case FONTATTR_MAX_LETTER_WIDTH: result = gFontInfos[fontId].maxLetterWidth; break; - case 1: + case FONTATTR_MAX_LETTER_HEIGHT: result = gFontInfos[fontId].maxLetterHeight; break; - case 2: + case FONTATTR_LETTER_SPACING: result = gFontInfos[fontId].letterSpacing; break; - case 3: + case FONTATTR_LINE_SPACING: result = gFontInfos[fontId].lineSpacing; break; - case 4: + case FONTATTR_COLOR_LOWNIBBLE: result = gFontInfos[fontId].fontColor_l; break; - case 5: + case FONTATTR_COLOR_FOREGROUND: result = gFontInfos[fontId].fgColor; break; - case 6: + case FONTATTR_COLOR_BACKGROUND: result = gFontInfos[fontId].bgColor; break; - case 7: + case FONTATTR_COLOR_SHADOW: result = gFontInfos[fontId].shadowColor; break; } |