Requested changes
This commit is contained in:
parent
7d6cf51b93
commit
54736b9c3c
@ -160,8 +160,7 @@ Result fontEnsureMapped(void);
|
|||||||
/**
|
/**
|
||||||
* @brief Fixes the pointers internal to a just-loaded font
|
* @brief Fixes the pointers internal to a just-loaded font
|
||||||
* @param font Font to fix
|
* @param font Font to fix
|
||||||
* @remark Should never be run on the system font, and only once
|
* @remark Should never be run on the system font, and only once on any other font.
|
||||||
* on any other font.
|
|
||||||
*/
|
*/
|
||||||
void fontFixPointers(CFNT_s* font);
|
void fontFixPointers(CFNT_s* font);
|
||||||
|
|
||||||
|
@ -34,13 +34,11 @@ void fontFixPointers(CFNT_s* font)
|
|||||||
font->finf.tglp->sheetData = (u8*)((u32)(font->finf.tglp->sheetData) + (u32) font);
|
font->finf.tglp->sheetData = (u8*)((u32)(font->finf.tglp->sheetData) + (u32) font);
|
||||||
|
|
||||||
font->finf.cmap = (CMAP_s*)((u32)(font->finf.cmap) + (u32) font);
|
font->finf.cmap = (CMAP_s*)((u32)(font->finf.cmap) + (u32) font);
|
||||||
CMAP_s* cmap = font->finf.cmap;
|
for (CMAP_s* cmap = font->finf.cmap; cmap->next; cmap = cmap->next)
|
||||||
for (; cmap->next; cmap = cmap->next)
|
|
||||||
cmap->next = (CMAP_s*)((u32)(cmap->next) + (u32) font);
|
cmap->next = (CMAP_s*)((u32)(cmap->next) + (u32) font);
|
||||||
|
|
||||||
font->finf.cwdh = (CWDH_s*)((u32)(font->finf.cwdh) + (u32) font);
|
font->finf.cwdh = (CWDH_s*)((u32)(font->finf.cwdh) + (u32) font);
|
||||||
CWDH_s* cwdh;
|
for (CWDH_s* cwdh = font->finf.cwdh; cwdh->next; cwdh = cwdh->next)
|
||||||
for (cwdh = font->finf.cwdh; cwdh->next; cwdh = cwdh->next)
|
|
||||||
cwdh->next = (CWDH_s*)((u32)(cwdh->next) + (u32) font);
|
cwdh->next = (CWDH_s*)((u32)(cwdh->next) + (u32) font);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +46,8 @@ int fontGlyphIndexFromCodePoint(CFNT_s* font, u32 codePoint)
|
|||||||
{
|
{
|
||||||
if (!font)
|
if (!font)
|
||||||
font = g_sharedFont;
|
font = g_sharedFont;
|
||||||
|
if (!font)
|
||||||
|
return -1;
|
||||||
int ret = font->finf.alterCharIndex;
|
int ret = font->finf.alterCharIndex;
|
||||||
if (codePoint < 0x10000)
|
if (codePoint < 0x10000)
|
||||||
{
|
{
|
||||||
@ -87,6 +87,8 @@ charWidthInfo_s* fontGetCharWidthInfo(CFNT_s* font, int glyphIndex)
|
|||||||
{
|
{
|
||||||
if (!font)
|
if (!font)
|
||||||
font = g_sharedFont;
|
font = g_sharedFont;
|
||||||
|
if (!font)
|
||||||
|
return NULL;
|
||||||
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)
|
||||||
@ -104,6 +106,8 @@ void fontCalcGlyphPos(fontGlyphPos_s* out, CFNT_s* font, int glyphIndex, u32 fla
|
|||||||
{
|
{
|
||||||
if (!font)
|
if (!font)
|
||||||
font = g_sharedFont;
|
font = g_sharedFont;
|
||||||
|
if (!font)
|
||||||
|
return;
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user