QT5在arm板上的汉字显示
2017-01-16 11:53
190 查看
1、准备好字库 xx.ttf文件
2、将xx.ttf放到 /usr/share/fonts/ 和 /usr/lib/fonts/ 下 (我自己这块板子需要两个地方都放,可以尝试只放在/usr/share/fonts/下)
3、执行fc-cache -fv 更新缓存
4、执行 fc-list可以参看arm已经支持的字体
root@am57xx-evm:/usr/bin# fc-list
/usr/share/fonts/ttf/LiberationSans-Italic.ttf: Liberation Sans:style=Italic
/usr/share/fonts/ttf/LiberationMono-Regular.ttf: Liberation Mono:style=Regular
/usr/share/fonts/ttf/LiberationSans-Bold.ttf: Liberation Sans:style=Bold
/usr/share/fonts/ttf/LiberationMono-BoldItalic.ttf: Liberation Mono:style=Bold Italic
/usr/share/fonts/ttf/LiberationSans-Regular.ttf: Liberation Sans:style=Regular
/usr/share/fonts/ttf/LiberationSerif-Bold.ttf: Liberation Serif:style=Bold
/usr/share/fonts/ttf/LiberationMono-Italic.ttf: Liberation Mono:style=Italic
/usr/share/fonts/ttf/LiberationSerif-Italic.ttf: Liberation Serif:style=Italic
/usr/share/fonts/ttf/LiberationSans-BoldItalic.ttf: Liberation Sans:style=Bold Italic
/usr/share/fonts/ttf/fzss.ttf: FZFangSong\-Z02S,方正仿宋简体:style=Regular
/usr/share/fonts/ttf/msyh.ttf: Microsoft YaHei,微软雅黑:style=Regular,Normal,oby?ejné,Standard,Κανονικ?,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
/usr/share/fonts/ttf/LiberationSerif-BoldItalic.ttf: Liberation Serif:style=Bold Italic
/usr/share/fonts/ttf/LiberationSerif-Regular.ttf: Liberation Serif:style=Regular
/usr/share/fonts/ttf/LiberationMono-Bold.ttf: Liberation Mono:style=Bold
root@am57xx-evm:/usr/bin#
5、在QT5应用中添加 以微软雅黑为例
QFont font("Microsoft YaHei");
a.setFont(font);
6、重启即可
2、将xx.ttf放到 /usr/share/fonts/ 和 /usr/lib/fonts/ 下 (我自己这块板子需要两个地方都放,可以尝试只放在/usr/share/fonts/下)
3、执行fc-cache -fv 更新缓存
4、执行 fc-list可以参看arm已经支持的字体
root@am57xx-evm:/usr/bin# fc-list
/usr/share/fonts/ttf/LiberationSans-Italic.ttf: Liberation Sans:style=Italic
/usr/share/fonts/ttf/LiberationMono-Regular.ttf: Liberation Mono:style=Regular
/usr/share/fonts/ttf/LiberationSans-Bold.ttf: Liberation Sans:style=Bold
/usr/share/fonts/ttf/LiberationMono-BoldItalic.ttf: Liberation Mono:style=Bold Italic
/usr/share/fonts/ttf/LiberationSans-Regular.ttf: Liberation Sans:style=Regular
/usr/share/fonts/ttf/LiberationSerif-Bold.ttf: Liberation Serif:style=Bold
/usr/share/fonts/ttf/LiberationMono-Italic.ttf: Liberation Mono:style=Italic
/usr/share/fonts/ttf/LiberationSerif-Italic.ttf: Liberation Serif:style=Italic
/usr/share/fonts/ttf/LiberationSans-BoldItalic.ttf: Liberation Sans:style=Bold Italic
/usr/share/fonts/ttf/fzss.ttf: FZFangSong\-Z02S,方正仿宋简体:style=Regular
/usr/share/fonts/ttf/msyh.ttf: Microsoft YaHei,微软雅黑:style=Regular,Normal,oby?ejné,Standard,Κανονικ?,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
/usr/share/fonts/ttf/LiberationSerif-BoldItalic.ttf: Liberation Serif:style=Bold Italic
/usr/share/fonts/ttf/LiberationSerif-Regular.ttf: Liberation Serif:style=Regular
/usr/share/fonts/ttf/LiberationMono-Bold.ttf: Liberation Mono:style=Bold
root@am57xx-evm:/usr/bin#
5、在QT5应用中添加 以微软雅黑为例
QFont font("Microsoft YaHei");
a.setFont(font);
6、重启即可
相关文章推荐
- QT开发之deigner+汉字显示等相关问题
- Qt 国际化编程解决汉字显示方块、乱码问题!
- 关于qt无法显示汉字的问题
- QT5.4.1在ARM开发板上不能显示汉字
- QT5.5.0+VS2013(X64)+hidapi的USB继续深究之 QT的汉字显示
- Qt 国际化编程,真正解决汉字显示方块、乱码问题!
- Qt 汉字显示问题//QTextCodec::setCodecForTr(QTextCodec::codecForName("gb18030"));
- 嵌入式QT程序的汉字显示
- qt中显示汉字乱码问题
- QT学习笔记----解决QT无法显示汉字问题
- Qt解决显示汉字的方法
- qt应用程序向arm板上移植中文不能正确显示的解决办法
- Qt4.7程序烧写或者到开发板时,汉字不能正常显示的解决方法
- 嵌入式 QT开发汉字显示问题tr函数
- Fedora14 基于Qt的UDP传输文字聊天小软件实现 (Qt查询本地Ip、Qt本地时间显示、传输中文汉字实现、Qt的textedit自动滚屏实现、给QPushButton设键盘快捷实现)---续上
- Qt显示汉字方法
- QTEmbedded汉字显示
- qt汉字显示的问题 && qt中不显示标题栏的方法
- Qt程序在ARM板上无法显示JPG格式图片的解决方法
- 如何在arm板上让Qt5.8显示中文