I need you help.
The problem that i want to talk let me break down.
I want to use a custom font in my program.so i add a font file(ttf format) in the construct funtion.it was work ,program print some string using my font style, but the problem is it just work on the first time ,when i second time start the program it don't work ,thease string can't print using my font style,i found my font is can't add in system.but when i restart Emulator,it was the same ,the first time i start the program ,it was no problem, but when i close the program,open the program again,it don't work!!!
I had try many times,over and over again.
here is my code,my Emulator is S60 3Rd mr
// in construct funtion
CWsScreenDevice* sScreenDevice = CEikonEnv::Static()->ScreenDevice();
TInt sNum = sScreenDevice->NumTypefaces();//sNum = 7 ,the number of system font is 7
TInt sResult = sScreenDevice->AddFile(KFontsimfang, iFontId); //every time the sResult is 0
sNum = sScreenDevice->NumTypefaces();
//when i start the program ,the first time sNum is 8,mean i add the font file success,
//but when i close the program ,start this program again ,the sNum alway is 7 mean that
// i add the font file is failed.what happen ? why the only first time is ok?
TFontSpec sSpec(KFontName, 150);
sScreenDevice->GetNearestFontInTwips(iMyFont, sSpec);//iMyFont is a CFont variable pointer
// in destructor funtion
CEikonEnv::Static()->ScreenDevice()->ReleaseFont( iMyFont );
iNormalFont = NULL;
in the sdk the ttf format font file is support.
why the program first time start is ok,but second time ,third time ... can't work!!!
when i restart my Emulator , it do so again.
some one can tell me?