如何改变CEikRichTextEditor的字体
来源:互联网 发布:做美工需要的基础 编辑:程序博客网 时间:2024/05/20 11:47
首先要得到字体,在2nd Edition SDK Feature Pack 2中, 中文字体只有CombinedChinesePlain12和CombinedChinesePlain16两种.默认的是CombinedChinesePlain12, 也就是EikEdwin字体只能在这两种字体中切CEikRichTextEditor字体要换为CombinedChinesePlain16,首先要得到相应字体, 有两种方法:
1) 用GetNearestFontInTwips.
TFontSpec sFontSpec;
sFontSpec.TTypeface.iName.Copy(_L("CombinedChinesePlain16"));
sFontSpec.iHeight = 190; // 应该是190,不太确实. 确实数字可以从第二种方法得到.
CFont * sFont;
CCoeEnv::Static()->ScreenDevice()->GetNearestFontInTwips(sFont,sFontSpec);
2) 用系统TitleFont的设定:
CFont* sFont = (CFont*) CEikonEnv::Static()->TitleFont();
得到相应字体后,应该可以改变CEikRichTextEditor字体了:
TFontSpec sFontSpec = sFont->FontSpecInTwips();
iCharFormatMask.SetAttrib(EAttFontTypeface);
iCharFormatMask.SetAttrib(EAttFontHeight);
iCharFormat.iFontSpec.iTypeface = sFontSpec.iTypeface;
iCharFormat.iFontSpec.iHeight = sFontSpec.iHeight;
SelectAll();
ApplyCharFormatL(iCharFormat, iCharFormatMask);
更多支持请到帖子:http://discussion.forum.nokia.com/forum/archive/index.php/t-70558.html
- 如何改变CEikRichTextEditor的字体
- 如何改变控件的字体
- 如何改变Edit框的字体颜色
- 如何改变CEdit的字体颜色大小
- 如何改变CEdit的字体颜色大小
- 如何改变MFC中控件的字体
- android 如何改变antionbar的字体颜色
- 如何改变编辑框字体的大小
- 如何改变新建幻灯片的默认字体
- MFC中如何改变字体的大小
- 如何改变字体风格
- 使用js如何改变一篇文章的字体的大小?
- iOS如何改变所有界面的状态栏的字体颜色
- CAknSettingItemList 如何改变 字体 颜色
- 如何改变textview中的字体
- 如何改变Eclipse中的字体
- CEikRichTextEditor 实现的两种方式
- 如何改变控件内的字体颜色(转)
- 诗歌:三年
- 在C#中使用存储过程
- ASP.NET上传文件面面观
- ASP和ASP.NET共用Cookies问题
- 防范SQL注入式攻击
- 如何改变CEikRichTextEditor的字体
- 使用js控制iframe中的各元素
- C#中导出电子表格Execl总结
- JSP、ASP.NET和存储过程
- Java版通用JS级联
- 印象·南湖
- Jpage分页 .net2.0版 通用.net2.0分页程序
- 第一次拥有自己的blog
- API 浏览器