symbian 修改字体属性_手机技巧教程-查字典教程网
symbian 修改字体属性
symbian 修改字体属性
发布时间:2015-05-12 来源:查字典编辑
摘要:CWindowGc&gc=SystemGc();//gc.Clear(aRect);//设置字体constCFont*font;font=i...

CWindowGc& gc = SystemGc();

//gc.Clear(aRect);

//设置字体

const CFont * font;

font = iEikonEnv->AnnotationFont();

TFontSpec fontSpec = font->FontSpecInTwips();

//设置字体平滑

fontSpec.iFontStyle.SetBitmapType(EAntiAliasedGlyphBitmap);

//设置字体高度

fontSpec.iHeight = KHeighFontTop;

gc.UseFont(font);

//绘图操作

gc.DiscardFont();

虽然,字体可以设置大小,但是有时候大小在symbian的模拟器中失效,不知道如何解决?

可以应用系统默认字体的大小暂时解决问题:

const CFont* iTitleFont = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont);

TRect rect(Rect());

gc.SetPenColor(KRgbYellow);

gc.UseFont(iTitleFont);

gc.DrawText(youstring, rect, rect.Height()/10, CGraphicsContext::ECenter );

gc.DiscardFont();

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新手机技巧学习
    热门手机技巧学习
    电脑基础子分类