135 float left, top, right, bottom;
140 float left, top, right, bottom;
170 extern CFNT_s* g_sharedFont;
@ CMAP_TYPE_SCAN
Mapping using a list of mapped characters.
Definition: font.h:57
@ CMAP_TYPE_TABLE
Mapping using a table.
Definition: font.h:56
@ CMAP_TYPE_DIRECT
Identity mapping.
Definition: font.h:55
void fontFixPointers(CFNT_s *font)
Fixes the pointers internal to a just-loaded font.
charWidthInfo_s * fontGetCharWidthInfo(CFNT_s *font, int glyphIndex)
Retrieves character width information of the specified glyph.
int fontGlyphIndexFromCodePoint(CFNT_s *font, u32 codePoint)
Retrieves the glyph index of the specified Unicode codepoint.
static CFNT_s * fontGetSystemFont(void)
Gets the currently loaded system font.
Definition: font.h:168
@ GLYPH_POS_AT_BASELINE
Position the glyph at the baseline instead of at the top-left corner.
Definition: font.h:148
@ GLYPH_POS_Y_POINTS_UP
Indicates that the Y axis points up instead of down.
Definition: font.h:149
@ GLYPH_POS_CALC_VTXCOORD
Calculates vertex coordinates in addition to texture coordinates.
Definition: font.h:147
static FINF_s * fontGetInfo(CFNT_s *font)
Retrieves the font information structure of a font.
Definition: font.h:180
Result fontEnsureMapped(void)
Ensures the shared system font is mapped.
void fontCalcGlyphPos(fontGlyphPos_s *out, CFNT_s *font, int glyphIndex, u32 flags, float scaleX, float scaleY)
Calculates position information for the specified glyph.
static void * fontGetGlyphSheetTex(CFNT_s *font, int sheetIndex)
Retrieves the pointer to texture data for the specified texture sheet.
Definition: font.h:203
static TGLP_s * fontGetGlyphInfo(CFNT_s *font)
Retrieves the texture sheet information of a font.
Definition: font.h:191
Font structure.
Definition: font.h:114
u32 signature
Signature (CFNU).
Definition: font.h:115
u16 endianness
Endianness constant (0xFEFF).
Definition: font.h:116
u16 headerSize
Header size.
Definition: font.h:117
u32 nBlocks
Number of blocks.
Definition: font.h:120
u32 fileSize
File size.
Definition: font.h:119
FINF_s finf
Font information.
Definition: font.h:122
u32 version
Format version.
Definition: font.h:118
Font information structure.
Definition: font.h:92
u32 sectionSize
Section size.
Definition: font.h:94
CWDH_s * cwdh
Pointer to the first character width information block.
Definition: font.h:103
u8 width
Font width.
Definition: font.h:107
CMAP_s * cmap
Pointer to the first character map.
Definition: font.h:104
charWidthInfo_s defaultWidth
Default character width information.
Definition: font.h:99
u8 fontType
Font type.
Definition: font.h:96
u8 lineFeed
Line feed vertical distance.
Definition: font.h:97
u8 ascent
Font ascent.
Definition: font.h:108
u8 height
Font height.
Definition: font.h:106
u32 signature
Signature (FINF).
Definition: font.h:93
u8 encoding
Font encoding (?)
Definition: font.h:100
TGLP_s * tglp
Pointer to texture sheet information.
Definition: font.h:102
u16 alterCharIndex
Glyph index of the replacement character.
Definition: font.h:98
Font texture sheet information.
Definition: font.h:21
u16 nSheets
Number of texture sheets.
Definition: font.h:28
u16 sheetFmt
GPU texture format (GPU_TEXCOLOR).
Definition: font.h:29
u16 nLines
Number of glyph rows per sheet.
Definition: font.h:32
u16 sheetHeight
Texture sheet height.
Definition: font.h:35
u16 sheetWidth
Texture sheet width.
Definition: font.h:34
u8 cellHeight
Height of a glyph cell.
Definition: font.h:23
u32 sheetSize
Size in bytes of a texture sheet.
Definition: font.h:27
u8 baselinePos
Vertical position of the baseline.
Definition: font.h:24
u8 cellWidth
Width of a glyph cell.
Definition: font.h:22
u16 nRows
Number of glyphs per row per sheet.
Definition: font.h:31
u8 * sheetData
Pointer to texture sheet data.
Definition: font.h:36
u8 maxCharWidth
Maximum character width.
Definition: font.h:25
Character width information structure.
Definition: font.h:13
u8 charWidth
Width of the character, that is, horizontal distance to advance.
Definition: font.h:16
s8 left
Horizontal offset to draw the glyph with.
Definition: font.h:14
u8 glyphWidth
Width of the glyph.
Definition: font.h:15
Font glyph position structure.
Definition: font.h:127
float xAdvance
Horizontal distance to advance after drawing the glyph.
Definition: font.h:130
float width
Glyph width.
Definition: font.h:131
int sheetIndex
Texture sheet index to use to render the glyph.
Definition: font.h:128
float xOffset
Horizontal offset to draw the glyph width.
Definition: font.h:129
Font character map structure.
Definition: font.h:65
u16 indexTable[0]
For CMAP_TYPE_TABLE: table of glyph indices.
Definition: font.h:75
u16 glyphIndex
Mapped glyph index.
Definition: font.h:84
u16 mappingMethod
Mapping method.
Definition: font.h:68
u16 codeBegin
First Unicode codepoint the block applies to.
Definition: font.h:66
struct tag_CMAP_s::@12::@14::@16 scanEntries[0]
Mapping pairs.
u16 indexOffset
For CMAP_TYPE_DIRECT: index of the first glyph.
Definition: font.h:74
u16 codeEnd
Last Unicode codepoint the block applies to.
Definition: font.h:67
u16 nScanEntries
Number of pairs.
Definition: font.h:79
CMAP_s * next
Pointer to the next map.
Definition: font.h:70
u16 code
Unicode codepoint.
Definition: font.h:83
Font character width information block structure.
Definition: font.h:44
u16 endIndex
Last Unicode codepoint the block applies to.
Definition: font.h:46
charWidthInfo_s widths[0]
Table of character width information structures.
Definition: font.h:49
u16 startIndex
First Unicode codepoint the block applies to.
Definition: font.h:45
CWDH_s * next
Pointer to the next block.
Definition: font.h:47
#define BIT(n)
Creates a bitmask from a bit number.
Definition: types.h:47
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
int8_t s8
8-bit signed integer
Definition: types.h:26
s32 Result
Function result.
Definition: types.h:42
uint16_t u16
16-bit unsigned integer
Definition: types.h:22
uint32_t u32
32-bit unsigned integer
Definition: types.h:23