QFontDatabase: Cannot find font directory
现象:
今天在银河麒麟操作系统上编译Qt 写的程序,报如下 错误:
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
QFontDatabase: Cannot find font directory /home/tgm/qt/qt_sdk/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
分析原因:这是因为没有Qt安装目录下没有字体文件导致的,我的Qt安装目录为:
/usr/local/Qt 5.9.2
字体目录一般在Qt安装目录下的lib/fonts下即:
/usr/local/Qt 5.9.2/lib/fonts
解决方法:
找一个安装了windows操作系统的机器,将其字体库(一般在C:\Windows\Fonts目录下,有的还很大,几百兆吧)拷贝到/usr/local/Qt 5.9.2/lib/fonts目录或者系统字体目录,如:我的银河麒麟操作系统字体存放目录为:
/usr/share/fonts
然后执行:
sudo vim /etc/profile
在其后加入如下代码:
export QT_QPA_FONTDIR=/usr/share/fonts
或
/usr/local/Qt 5.9.2/lib/fonts
重启系统即可。
注意:windows下的字体库很大,我的444MB,对于嵌入式的、磁盘空间有限的情况,请根据你要的字体进行删减,以节约空间。
QFontDatabase: Cannot find font directory相关推荐
- QFontDatabase: Cannot find font directory .../lib/fonts
银河麒麟V10 SP1 2203, 飞腾CPU D2000/8. 安装完Qt 5.9.9之后,程序运行发现只有界面没有文字,提示 Cannot find font directory /home/yw ...
- 银河麒麟aarchQt5.12.0 QtFontDatabase: Cannot find font directory
银河麒麟aarch64 V10 安装Qt5.12.0以后界面程序出现QFontDatabase: Cannot find font directory /usr/local/Qt-5.12.0/lib ...
- Qt5.6.1如何使用qpf2字体
最近在移植Qt到一个商用的小众系统上,Qt版本是Qt5.6.1,Qt是不支持这个系统的,在移植过程中遇到了很多的问题,这里对字体移植遇的问题进行一下记录.(这个办法是可以使用qpf2字体的,但是是不是 ...
- linux开发板添加qt库文件_QT程序怎么移植到开发板并运行
需要的条件: 1.上位机编译好的可执行文件,以hello为例 在虚拟机的Ubuntu下,写好代码之后,定位到当前目录,执行命令 $ qmake -project //生成工程文件.pro $ qmak ...
- ubuntu交叉编译Qt-5库并移植ARM开发板
前言:本文将介绍Qt5源码方式的交叉编译及安装 下载源码包:qt-everywhere-src-5.12.8.tar.xz 官网下载网址:Index of / 依次选择: [official_rele ...
- qt做标定软件_Qt Embedded 4.5.3 的移植和触摸屏校正
在进行Qt/E的移植和触摸屏校正的实践过程中,不得不感慨一下国内的学术文章真是天下一大抄,想 找点有价值的资料还真得累个精疲力竭.可恶的是,转载的文章也不标明,搞得就像是自己原创的一样,其中有多少人真 ...
- 解决开发板运行QT后找不到字体文件
QT版本:5.91 错误:QFontDatabase: Cannot find font directory '/usr/lib/fonts'. 解决方法: 方法1: 从PC端的qt安装目录下拷贝fo ...
- 使用Google Font API
Google在5月20日宣布推出Google Font Directory 和Google Font API 两项服务.在Google Font Directory中,Google联合了众多的字体设计 ...
- Font Configuration and Customization for Open Source Systems - 白皮书翻译和深入
font config 作为一个linux系统的font的配置的基本要素,如何使用的一份手册翻译: 本文尝试从font config手册出发,介绍font config的基本概念和基本元素,以期待在了 ...
最新文章
- 世界首部AI创作漫画正式发表:StyleGAN神还原《铁臂阿童木》画风,继承手冢治虫衣钵...
- synology_用于在Synology NAS上测试Spring Boot Web应用程序的JUnit模拟文件
- Windows下Unity5x的下载
- springcloud 整合 gateway_GitHub上最火的SpringCloud微服务商城系统项目,附全套教程
- C#中的Lock锁深入理解
- 设置Tomcat管理员用户名和密码
- MySQL笔记-解决...mysql.sock (13)(两种情况会产生此问题)
- 如何快速提升 Go 程序性能?
- web:网站性能工具Yslow
- 写给MongoDB开发者的50条建议Tip14
- 【路径规划】基于matlab蚁群和粒子群算法双机器人协调路径规划【含Matlab源码 045期】
- Containerd 错误报错解决Failed to start containerd container runtime.
- 领航优配|券商板块大幅走高,东方财富盘中涨超15%
- 请大家帮忙看下这个shader的问题:
- [pwnable.kr]shellshock
- 计算思维应用于计算机学科,【计算机教学论文】计算机教学中的计算思维培养(共2667字)...
- 数字电路2. OC门、OD门、三态门
- pycharm更改整体背景颜色(黑-白)
- plt.pie()参数解释
- vue el-dialog 实现弹窗无限嵌套(点击弹窗弹出新的弹窗,可以一直点击)