1. 加载第三方字体库
1.1 指定字体库
_LIT16(KFontFile0,"E://myfonts//FZZhiYiCOMIC.ttf"); _LIT16(KMyFont0,"FZZhiYi - Kelvin"); _LIT16(KFontFile2,"E://myfonts//simhei.ttf"); _LIT16(KMyFont2,"SimHei"); _LIT16(KFontFile1,"E://myfonts//simkai.ttf"); _LIT16(KMyFont1,"KaiTi_GB2312"); TPtrC16 fontFile[3]; TPtrC16 fontName[3]; TInt fontID[3]; fontFile[0].Set(KFontFile0); fontName[0].Set(KMyFont0); fontFile[1].Set(KFontFile1); fontName[1].Set(KMyFont1); fontFile[2].Set(KFontFile2); fontName[2].Set(KMyFont2);
2.1 加载字体库
CWsScreenDevice *sScreenDevice = CEikonEnv::Static()->ScreenDevice(); TInt oldCount = 0, newCount = 0; oldCount = sScreenDevice->NumTypefaces(); TInt fontErr = KErrNone; for(TInt i = 0; i < 3; i++){ fontID[i] = -1; User::LeaveIfError( sScreenDevice->AddFile(fontFile[i], fontID[i]) ); newCount = sScreenDevice->NumTypefaces(); if( oldCount + 1 == newCount ) // successful{oldCount = newCount;} else // failed{// list all the typefaces.TTypefaceSupport typefaceInfo;for(TInt i1 = 0; i1 < newCount; i1++){sScreenDevice->TypefaceSupport(typefaceInfo, i1);RDebug::Print(_L("Typeface %d: %S"),i1, &(typefaceInfo.iTypeface.iName));}sScreenDevice->RemoveFile(fontID[i]);fontID[i] = -1;User::Leave(KErrGeneral);} }
2.3 卸载字体库
CFont *font; for(TInt i = 0;i < 3;i++){ font = NULL; TFontSpec fontSpeci(fontName[i], 137); User::LeaveIfError( sScreenDevice->GetNearestFontInTwips(font, fontSpeci) ); sScreenDevice->ReleaseFont( font ); if(fontID[i] >= 0)sScreenDevice->RemoveFile(fontID[i]); }
============================================================================
相关知识
字体库管理
字体库大全
word字体库
如何在Mac OS上管理和组织字体库
ai生成字体库
移动应用中字体库的设计与实现
图片转web字体库,如何制作web字体库
微软字体库下载,探索字体的世界
前端工程配置字体库
免越狱教你在 iPhone 上添加字体库
网址: 管理 Symbian 中字体库 https://m.huajiangbk.com/newsview741800.html
上一篇: 【CAD字体库大全和巨虎时间管理 |
下一篇: 「美团地推管理方案」美团地推策略 |