Fix comments and change from "fontGetSystemFont()" to "g_sharedFont"

This commit is contained in:
piepie62 2019-02-05 10:28:56 -07:00
parent 1125e77e2a
commit 8f0c888139
2 changed files with 11 additions and 11 deletions

View File

@ -173,8 +173,8 @@ static inline CFNT_s* fontGetSystemFont(void)
} }
/** /**
* @brief Retrieves the font information structure of the shared system font. * @brief Retrieves the font information structure of a font.
* @param font Font from which to get information * @param font Pointer to font structure. If NULL, the shared system font is used.
*/ */
static inline FINF_s* fontGetInfo(CFNT_s* font) 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. * @brief Retrieves the texture sheet information of a font.
* @param font Font from which to get information * @param font Pointer to font structure. If NULL, the shared system font is used.
*/ */
static inline TGLP_s* fontGetGlyphInfo(CFNT_s* font) 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. * @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. * @param sheetIndex Index of the texture sheet.
*/ */
static inline void* fontGetGlyphSheetTex(CFNT_s* font, int sheetIndex) 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. * @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. * @param codePoint Unicode codepoint.
*/ */
int fontGlyphIndexFromCodePoint(CFNT_s* font, u32 codePoint); int fontGlyphIndexFromCodePoint(CFNT_s* font, u32 codePoint);
/** /**
* @brief Retrieves character width information of the specified glyph. * @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. * @param glyphIndex Index of the glyph.
*/ */
charWidthInfo_s* fontGetCharWidthInfo(CFNT_s* font, int glyphIndex); 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. * @brief Calculates position information for the specified glyph.
* @param out Output structure in which to write the information. * @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 glyphIndex Index of the glyph.
* @param flags Calculation flags (see GLYPH_POS_* flags). * @param flags Calculation flags (see GLYPH_POS_* flags).
* @param scaleX Scale factor to apply horizontally. * @param scaleX Scale factor to apply horizontally.

View File

@ -47,7 +47,7 @@ void fontFixPointers(CFNT_s* font)
int fontGlyphIndexFromCodePoint(CFNT_s* font, u32 codePoint) int fontGlyphIndexFromCodePoint(CFNT_s* font, u32 codePoint)
{ {
if (!font) if (!font)
font = fontGetSystemFont(); font = g_sharedFont;
int ret = font->finf.alterCharIndex; int ret = font->finf.alterCharIndex;
if (codePoint < 0x10000) if (codePoint < 0x10000)
{ {
@ -86,7 +86,7 @@ int fontGlyphIndexFromCodePoint(CFNT_s* font, u32 codePoint)
charWidthInfo_s* fontGetCharWidthInfo(CFNT_s* font, int glyphIndex) charWidthInfo_s* fontGetCharWidthInfo(CFNT_s* font, int glyphIndex)
{ {
if (!font) if (!font)
font = fontGetSystemFont(); font = g_sharedFont;
charWidthInfo_s* info = NULL; charWidthInfo_s* info = NULL;
CWDH_s* cwdh; CWDH_s* cwdh;
for (cwdh = font->finf.cwdh; cwdh && !info; cwdh = cwdh->next) 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) void fontCalcGlyphPos(fontGlyphPos_s* out, CFNT_s* font, int glyphIndex, u32 flags, float scaleX, float scaleY)
{ {
if (!font) if (!font)
font = fontGetSystemFont(); font = g_sharedFont;
FINF_s* finf = &font->finf; FINF_s* finf = &font->finf;
TGLP_s* tglp = finf->tglp; TGLP_s* tglp = finf->tglp;
charWidthInfo_s* cwi = fontGetCharWidthInfo(font, glyphIndex); charWidthInfo_s* cwi = fontGetCharWidthInfo(font, glyphIndex);