uiq3.0sdk最终版模拟器显示中文

来源:互联网 发布:二胡淘宝网 编辑:程序博客网 时间:2024/05/17 09:26

1. 备份SDK安装目录下的"/epoc32/release/winscw/udeb/Z/Resource/Fonts"目录及该目录下所有文件,随后删除该目录下所有文件
2. 拷贝Windows中的“仿宋体”字体文件到1.中的字体目录中。我用的是Windows 2000 Professional Edition SP4,因此拷贝了"C:/WINNT/Fonts/simfang.ttf"
3. 修改SDK安装目录下的"/Examples/UIQ/QHelloWorld"示例程序,
// HelloWorldView.cpp
...
#include <eiklabel.h> // for CEikLabel
...
void CHelloWorldView::ViewConstructL()
{
// Loads information about the UI configurations this view supports
// together with definition of each view.
ViewConstructFromResourceL(R_HELLOWORLD_UI_CONFIGURATIONS);

CEikLabel* label = LocateControlByUniqueHandle<CEikLabel>(EHelloWorldLabelCtrl);
_LIT(KTest, "test/u6211"); // 6211是“我”字的16进制Unicode值
label->SetTextL(KTest);
}
...

4. Build修改后的示例程序
bldmake bldfiles
abld build winscw udeb

5. 启动仿真器后打开HelloWorld程序即可看到屏幕中间的Lable控件上显示着字符串"test我"。

    如果楼主替换了字体文件后仍无法在自己的程序中显示中文,则有可能是你的程序有问题,具体问题具体分析吧。