智手移动中文网's Archiver

智手小石头 发表于 2006-5-9 11:07

Symbian系统的字体集合

CCoeEnv::Static()->NormalFont()
CEikonEnv::Static()->AnnotationFont()
CEikonEnv::Static()->TitleFont()
CEikonEnv::Static()->LegendFont()
CEikonEnv::Static()->SymbolFont()
CEikonEnv::Static()->DenseFont()

具体用哪一种最好在真机上测试一下才能保险喔!
下面的是自己手动创建和选择一个字体的代码
// Get an alternative font
_LIT(KMyFontName,"Swiss");
CFont* myFont;
TFontSpec myFontSpec(KMyFontName,1); // to get smallest Swiss font
CGraphicsDevice* screenDevice=iCoeEnv->ScreenDevice();
screenDevice->GetNearestFontInTwips(myFont,myFontSpec);
gc.UseFont(myFont);

// Set the text drawing position & draw
// Note: using the overload of DrawText() that
// draws a background box may give less flicker
TInt fontDescent=myFont->DescentInPixels();
TPoint pos(0,tinyBox.Height()-fontDescent);
pos+=tinyBox.iTl;
_LIT(KMyText,"This text to write");
gc.DrawText(KMyText,pos);

// Discard and destroy the font
gc.DiscardFont();
screenDevice->ReleaseFont(myFont);

不过默认情况下,只有CEikonEnv::Static()->TitleFont()和CCoeEnv::Static()->NormalFont()

可以用来显示中文。

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.