CCoeEnv::Static()->NormalFont()
CEikonEnv::Static()->AnnotationFont()
CEikonEnv::Static()->TitleFont()
CEikonEnv::Static()->LegendFont()
CEikonEnv::Static()->SymbolFont()
CEikonEnv::Static()->DenseFont()
改变字体
在第三版的可以这样
CFont *font = NULL;
TFontSpec fontSpec = iEikonEnv->TitleFont()->FontSpecInTwips();
fontSpec.iHeight *= 0.8;
iCoeEnv->ScreenDevice()->GetNearestFontInTwips(font,fontSpec);
_LIT(KMyFontName,"Swiss");
TFontSpec myFontSpec1(KMyFontName,200);
CFont* myFont1;
//加粗
myFontSpec1.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
//斜体
myFontSpec1.iFontStyle.SetPosture(EPostureItalic);
//阳文
myFontSpec1.iFontStyle.SetEffects(FontEffect::EEmbossed,ETrue);
//获取字体
iFbsScreenDevice->GetNearestFontToMaxHeightInTwips(myFont1, myFontSpec1, 220);
//选择字体
iFbsBitGc->UseFont(myFont1);
//设置画笔颜色为红色
iFbsBitGc->SetPenColor(KRgbRed);
_LIT(KText, "This is a Test!");
TBufC<20> text (KText);
iFbsBitGc ->DrawText(text, TPoint(120, 200));
iFbsScreenDevice->Update();
// Discard and destroy the font
iFbsScreenDevice->ReleaseFont(myFont1);
本文介绍在Symbian系统中如何通过调整字体规格来实现字体大小的变化,并演示了如何创建并使用自定义字体的过程,包括字体样式的设置、获取最近的字体以及在屏幕设备上绘制文本。

被折叠的 条评论
为什么被折叠?



