![]() |
MPLABĀ® Harmony Graphics Suite
GFX v3.13.0
Legato API Documentation
|
Font functions and definitions. More...


Go to the source code of this file.
Data Structures | |
| struct | leFontGlyph |
| This struct represents a font glyph. More... | |
| struct | leFont |
| This struct represents a font object. More... | |
| struct | leRasterFont |
| This struct represents a rasterized font object. More... | |
Typedefs | |
| typedef enum leFontBPP | leFontBPP |
| This enum represents a font. More... | |
| typedef struct leFontGlyph | leFontGlyph |
| This struct represents a font glyph. More... | |
| typedef enum leFontType | leFontType |
| This enum represents a font type. More... | |
| typedef enum leFontFlags | leFontFlags |
| Defines font attribute flags. | |
| typedef struct leFont | leFont |
| This struct represents a font object. More... | |
| typedef struct leRasterFont | leRasterFont |
| This struct represents a rasterized font object. More... | |
Enumerations | |
| enum | leFontBPP { LE_FONT_BPP_1, LE_FONT_BPP_8 } |
| This enum represents a font. More... | |
| enum | leFontType { LE_RASTER_FONT, LE_VECTOR_FONT } |
| This enum represents a font type. More... | |
| enum | leFontFlags { LE_FONT_RIGHTTOLEFT = 0x1 } |
| Defines font attribute flags. | |
Functions | |
| leResult | leFont_GetGlyphInfo (const leFont *fnt, uint32_t codepoint, leFontGlyph *glyph) |
| Get glyph info. More... | |
| leResult | leFont_GetGlyphRect (const leFontGlyph *glyph, leRect *rect) |
| Get glyph rectangle. More... | |
| leResult | leFont_DrawGlyph (const leFont *fnt, const leFontGlyph *glyph, int32_t x, int32_t y, leColor clr, uint32_t a) |
| Draws a glyph. More... | |
| leResult | leFont_DrawGlyph_Lookup (const leFont *fnt, const leFontGlyph *glyph, int32_t x, int32_t y, const leBlendLookupTable *tbl) |
| Draws a glyph using a provided font and color lookup table. More... | |
| leResult | leFont_DrawGlyphData (const leFont *fnt, const leFontGlyph *glyph, const uint8_t *data, int32_t x, int32_t y, leColor clr, uint32_t a) |
| Draws a glyph. More... | |
| leResult | leFont_DrawGlyphData_Lookup (const leFont *fnt, const leFontGlyph *glyph, const uint8_t *data, int32_t x, int32_t y, const leBlendLookupTable *tbl) |
| Draws a glyph using a provided font and color lookup table. More... | |
Font functions and definitions.
Describes font assets and type definitions.
This struct represents a font object.
All fonts have a header and font type.
This enum represents a font.
This is used to provide possible font types either standard or antialized.
| typedef struct leFontGlyph leFontGlyph |
This struct represents a font glyph.
This is used describe a individual character of a font. Each glyph contains kerning data and options unique to itself. This data is used for proper glyph positioning when rendering text.
| typedef enum leFontType leFontType |
This enum represents a font type.
Currently only raster fonts are supported but this differentiation will allow for future expansion into vector font support.
| typedef struct leRasterFont leRasterFont |
This struct represents a rasterized font object.
A raster font asset is a series of raster images that represent linguistic characters. These characters are referenced by an index called a 'code point'. This code point is 1-2 bytes in length. Code points may be encoded to save space. Fonts also contain general kerning data that describes character positioning data.
| enum leFontBPP |
| enum leFontType |
This enum represents a font type.
Currently only raster fonts are supported but this differentiation will allow for future expansion into vector font support.
| leResult leFont_DrawGlyph | ( | const leFont * | fnt, |
| const leFontGlyph * | glyph, | ||
| int32_t | x, | ||
| int32_t | y, | ||
| leColor | clr, | ||
| uint32_t | a | ||
| ) |
Draws a glyph.
Draws a glyph glyph to location x, y with color clr and alpha a.
| x | the screen x location to draw |
| y | the screen y location to draw |
| glyph | the glyph kerning information |
| clr | the glyph render color |
| a | global alpha value to apply |
| leResult leFont_DrawGlyph_Lookup | ( | const leFont * | fnt, |
| const leFontGlyph * | glyph, | ||
| int32_t | x, | ||
| int32_t | y, | ||
| const leBlendLookupTable * | tbl | ||
| ) |
Draws a glyph using a provided font and color lookup table.
Uses a font fnt to draw a glyph glyph to location x, y. This function uses the alpha value of each glyph pixel as an index into a color lookup table tbl.
| fnt | the font to use |
| glyph | the glyph to draw |
| x | the screen x location to draw at |
| y | the screen y location to draw at |
| tbl | the color lookup table to reference |
| leResult leFont_DrawGlyphData | ( | const leFont * | fnt, |
| const leFontGlyph * | glyph, | ||
| const uint8_t * | data, | ||
| int32_t | x, | ||
| int32_t | y, | ||
| leColor | clr, | ||
| uint32_t | a | ||
| ) |
Draws a glyph.
Draws a glyph glyph from data to location x, y with color clr and alpha a.
| x | the screen x location to draw |
| y | the screen y location to draw |
| glyph | the glyph kerning information |
| clr | the glyph render color |
| a | global alpha value to apply |
| leResult leFont_DrawGlyphData_Lookup | ( | const leFont * | fnt, |
| const leFontGlyph * | glyph, | ||
| const uint8_t * | data, | ||
| int32_t | x, | ||
| int32_t | y, | ||
| const leBlendLookupTable * | tbl | ||
| ) |
Draws a glyph using a provided font and color lookup table.
Uses a font fnt to draw a glyph glyph from a raw data pointer data to location x, y. This function uses the alpha value of each glyph pixel as an index into a color lookup table tbl.
| fnt | the font to use |
| glyph | the glyph to draw |
| x | the screen x location to draw at |
| y | the screen y location to draw at |
| tbl | the color lookup table to reference |
| leResult leFont_GetGlyphInfo | ( | const leFont * | fnt, |
| uint32_t | codepoint, | ||
| leFontGlyph * | glyph | ||
| ) |
Get glyph info.
Get glyph info glyph by fnt and codepoint.
| fnt | the font to query |
| codepoint | the codepoint to lookup |
| glyph | the glyph data that was retrieved. |
| leResult leFont_GetGlyphRect | ( | const leFontGlyph * | glyph, |
| leRect * | rect | ||
| ) |
Get glyph rectangle.
Gets a glyph rectangle rect by glyph.
| glyph | is an integer. |
| rect | is an integer. |