WEB开发网      婵傜晫鐝總钘夊瀻娴滎偓绱掓担鐘垫畱娑撯偓娴犺棄鍨庢禍顐fЦ閹存垳婊戦惃鍕娴犺棄濮╅崝娑崇幢鐠囧嘲鍨庢禍锟� ---閿曪拷
开发学院手机开发Symbian 开发 symbian 修改字体属性 阅读

symbian 修改字体属性

 2010-10-20 08:00:23 来源:WEB开发网 閵嗭拷閸戝繐鐨€涙ぞ缍�婢х偛銇囩€涙ぞ缍�閵嗭拷  閸忚櫕鏁炴Λ娆愬盁閸楀洨娈戝顔煎触
核心提示:CWindowGc& gc = SystemGc();//gc.Clear(aRect);//设置字体const CFont * font;font = iEikonEnv->AnnotationFont();TFontSpec fontSpec = font->FontSpecInTwips();//设置

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();

Tags:symbian 修改 字体

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接