libctru
v2.4.1
|
Shared font support. More...
#include <3ds/types.h>
Go to the source code of this file.
Data Structures | |
struct | charWidthInfo_s |
Character width information structure. More... | |
struct | TGLP_s |
Font texture sheet information. More... | |
struct | CWDH_s |
Font character width information block structure. More... | |
struct | CMAP_s |
Font character map structure. More... | |
struct | FINF_s |
Font information structure. More... | |
struct | CFNT_s |
Font structure. More... | |
struct | fontGlyphPos_s |
Font glyph position structure. More... | |
Enumerations | |
Data types | |
enum | { CMAP_TYPE_DIRECT = 0 , CMAP_TYPE_TABLE = 1 , CMAP_TYPE_SCAN = 2 } |
Font character map methods. More... | |
enum | { GLYPH_POS_CALC_VTXCOORD = BIT(0) , GLYPH_POS_AT_BASELINE = BIT(1) , GLYPH_POS_Y_POINTS_UP = BIT(2) } |
Flags for use with fontCalcGlyphPos. More... | |
Functions | |
Initialization and basic operations | |
Result | fontEnsureMapped (void) |
Ensures the shared system font is mapped. | |
void | fontFixPointers (CFNT_s *font) |
Fixes the pointers internal to a just-loaded font. More... | |
static CFNT_s * | fontGetSystemFont (void) |
Gets the currently loaded system font. | |
static FINF_s * | fontGetInfo (CFNT_s *font) |
Retrieves the font information structure of a font. More... | |
static TGLP_s * | fontGetGlyphInfo (CFNT_s *font) |
Retrieves the texture sheet information of a font. More... | |
static void * | fontGetGlyphSheetTex (CFNT_s *font, int sheetIndex) |
Retrieves the pointer to texture data for the specified texture sheet. More... | |
int | fontGlyphIndexFromCodePoint (CFNT_s *font, u32 codePoint) |
Retrieves the glyph index of the specified Unicode codepoint. More... | |
charWidthInfo_s * | fontGetCharWidthInfo (CFNT_s *font, int glyphIndex) |
Retrieves character width information of the specified glyph. More... | |
void | fontCalcGlyphPos (fontGlyphPos_s *out, CFNT_s *font, int glyphIndex, u32 flags, float scaleX, float scaleY) |
Calculates position information for the specified glyph. More... | |
Shared font support.
anonymous enum |
anonymous enum |
Flags for use with fontCalcGlyphPos.
void fontCalcGlyphPos | ( | fontGlyphPos_s * | out, |
CFNT_s * | font, | ||
int | glyphIndex, | ||
u32 | flags, | ||
float | scaleX, | ||
float | scaleY | ||
) |
Calculates position information for the specified glyph.
out | Output structure in which to write the information. |
font | Pointer to font structure. If NULL, the shared system font is used. |
glyphIndex | Index of the glyph. |
flags | Calculation flags (see GLYPH_POS_* flags). |
scaleX | Scale factor to apply horizontally. |
scaleY | Scale factor to apply vertically. |
void fontFixPointers | ( | CFNT_s * | font | ) |
Fixes the pointers internal to a just-loaded font.
font | Font to fix |
charWidthInfo_s* fontGetCharWidthInfo | ( | CFNT_s * | font, |
int | glyphIndex | ||
) |
Retrieves character width information of the specified glyph.
font | Pointer to font structure. If NULL, the shared system font is used. |
glyphIndex | Index of the glyph. |
Retrieves the texture sheet information of a font.
font | Pointer to font structure. If NULL, the shared system font is used. |
|
inlinestatic |
Retrieves the pointer to texture data for the specified texture sheet.
font | Pointer to font structure. If NULL, the shared system font is used. |
sheetIndex | Index of the texture sheet. |
Retrieves the font information structure of a font.
font | Pointer to font structure. If NULL, the shared system font is used. |