Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Dear all,
I had a question about font and memory loss.

I load custom font in core_ui.c (CoreTask_init API) and save them in global variable (gp_TTFontArray[i])

ex:ICreateFonts((IShell*) AEE_GetShell(), 0, &g_TTFontArray[i], g_TTFontSizes[i], g_TTFontStyle[i]);

In power on, Font will be load to gp_TTFontArray[i]. But when program run to appidle.c (CoreApp_InitAppData) the font data in gp_FontSource[i] was loss and overwrite by other data. Such that i can't use the font resource.

I try to use
pac = (ACONTEXT*) AEE_EnterAppContext(NULL);
ICreateFonts((IShell*) AEE_GetShell(), 0, &g_TTFontArray[i], g_TTFontSizes[i], g_TTFontStyle[i]);
AEE_LeaveAppContext(pac);

to keep font resource util power down.

But this method don't OK!

If any idle offer to me?

Otherwise, when we use IDISPLAY_SetFont(IDisplay * po, AEEFont nFont, IFont *piNewFont). The piNewFont is font resource. Is there any method to know the size of piNewFont? I want to use OEM_Malloc to malloc memory to keep font resource.