18 pResource->uiRefCount++;
22 pResource = FindUnusedFontResource();
38 pResource->uiRefCount++;
39 CreateFontFromResource( pResource );
115void AGUI2FontManager::CreateFontFromResource(
AGUI2FontResource* a_pFontResource )
117 auto& trb = a_pFontResource->
oTRB;
119 for (
TINT i = 0; i < trb.GetNumSymbols(); i++ )
121 auto pSymbol = trb.GetSymbol( i );
122 auto pSymbolName = trb.GetSymbolName( pSymbol );
126 if ( pFontRef ==
TNULL )
128 pFontRef = FindUnusedFontRef();
131 if ( pFontRef ==
TNULL )
return;
136 auto pFontDef = trb.CastSymbol<AGUI2FontDef>( pSymbolName );
137 pFontRef->pFont =
new AGUI2Font();
138 pFontRef->pFont->Create( pFontDef );
139 pFontRef->pFontResource = a_pFontResource;
140 pFontRef->Unk1 =
TNULL;
#define TOSHI_NAMESPACE_USING
static TSIZE String8Length(const TCHAR *str)
static TINT String8CompareNoCase(const TCHAR *str1, const TCHAR *str2, TSIZE size=-1)
static TCHAR * String8Copy(TCHAR *dst, const TCHAR *src, TSIZE size=-1)
static AGUI2FontRef * FindFontRef(const TCHAR *a_szFontName)
static constexpr TUINT MAX_NUM_FONT_REFS
static TBOOL Open(const TCHAR *a_szFileName)
static AGUI2FontResource * FindFontResource(const TCHAR *a_szResourceName)
static AGUI2FontResource s_fontresources[MAX_NUM_LOADED_FONTS]
static constexpr TUINT MAX_NUM_LOADED_FONTS
static AGUI2FontRef s_fontrefs[MAX_NUM_FONT_REFS]
static AGUI2Font * FindFont(const TCHAR *a_szFontName)