From 8f0c888139493b54937d5237062f0ef71e932d8f Mon Sep 17 00:00:00 2001 From: piepie62 Date: Tue, 5 Feb 2019 10:28:56 -0700 Subject: [PATCH] Fix comments and change from "fontGetSystemFont()" to "g_sharedFont" --- libctru/include/3ds/font.h | 16 ++++++++-------- libctru/source/font.c | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libctru/include/3ds/font.h b/libctru/include/3ds/font.h index 3d3ce62..3fec388 100644 --- a/libctru/include/3ds/font.h +++ b/libctru/include/3ds/font.h @@ -173,8 +173,8 @@ static inline CFNT_s* fontGetSystemFont(void) } /** - * @brief Retrieves the font information structure of the shared system font. - * @param font Font from which to get information + * @brief Retrieves the font information structure of a font. + * @param font Pointer to font structure. If NULL, the shared system font is used. */ static inline FINF_s* fontGetInfo(CFNT_s* font) { @@ -184,8 +184,8 @@ static inline FINF_s* fontGetInfo(CFNT_s* font) } /** - * @brief Retrieves the texture sheet information of the shared system font. - * @param font Font from which to get information + * @brief Retrieves the texture sheet information of a font. + * @param font Pointer to font structure. If NULL, the shared system font is used. */ static inline TGLP_s* fontGetGlyphInfo(CFNT_s* font) { @@ -196,7 +196,7 @@ static inline TGLP_s* fontGetGlyphInfo(CFNT_s* font) /** * @brief Retrieves the pointer to texture data for the specified texture sheet. - * @param font Font from which to get information. + * @param font Pointer to font structure. If NULL, the shared system font is used. * @param sheetIndex Index of the texture sheet. */ static inline void* fontGetGlyphSheetTex(CFNT_s* font, int sheetIndex) @@ -209,14 +209,14 @@ static inline void* fontGetGlyphSheetTex(CFNT_s* font, int sheetIndex) /** * @brief Retrieves the glyph index of the specified Unicode codepoint. - * @param font Font from which to get information. + * @param font Pointer to font structure. If NULL, the shared system font is used. * @param codePoint Unicode codepoint. */ int fontGlyphIndexFromCodePoint(CFNT_s* font, u32 codePoint); /** * @brief Retrieves character width information of the specified glyph. - * @param font Font from which to get information. + * @param font Pointer to font structure. If NULL, the shared system font is used. * @param glyphIndex Index of the glyph. */ charWidthInfo_s* fontGetCharWidthInfo(CFNT_s* font, int glyphIndex); @@ -224,7 +224,7 @@ charWidthInfo_s* fontGetCharWidthInfo(CFNT_s* font, int glyphIndex); /** * @brief Calculates position information for the specified glyph. * @param out Output structure in which to write the information. - * @param font Font from which to get information. + * @param font Pointer to font structure. If NULL, the shared system font is used. * @param glyphIndex Index of the glyph. * @param flags Calculation flags (see GLYPH_POS_* flags). * @param scaleX Scale factor to apply horizontally. diff --git a/libctru/source/font.c b/libctru/source/font.c index 5e5f0fc..2960ece 100644 --- a/libctru/source/font.c +++ b/libctru/source/font.c @@ -47,7 +47,7 @@ void fontFixPointers(CFNT_s* font) int fontGlyphIndexFromCodePoint(CFNT_s* font, u32 codePoint) { if (!font) - font = fontGetSystemFont(); + font = g_sharedFont; int ret = font->finf.alterCharIndex; if (codePoint < 0x10000) { @@ -86,7 +86,7 @@ int fontGlyphIndexFromCodePoint(CFNT_s* font, u32 codePoint) charWidthInfo_s* fontGetCharWidthInfo(CFNT_s* font, int glyphIndex) { if (!font) - font = fontGetSystemFont(); + font = g_sharedFont; charWidthInfo_s* info = NULL; CWDH_s* cwdh; for (cwdh = font->finf.cwdh; cwdh && !info; cwdh = cwdh->next) @@ -103,7 +103,7 @@ charWidthInfo_s* fontGetCharWidthInfo(CFNT_s* font, int glyphIndex) void fontCalcGlyphPos(fontGlyphPos_s* out, CFNT_s* font, int glyphIndex, u32 flags, float scaleX, float scaleY) { if (!font) - font = fontGetSystemFont(); + font = g_sharedFont; FINF_s* finf = &font->finf; TGLP_s* tglp = finf->tglp; charWidthInfo_s* cwi = fontGetCharWidthInfo(font, glyphIndex);