当前位置:网站首页>QT add external font ttf
QT add external font ttf
2022-04-23 18:15:00 【Talent、me】
Get local font
#include <QFontDatabase>
QFontDatabase fontbase;
// Traverse local font
foreach (const QString &fontfamily, fontbase.families()) {
qDebug()<<fontfamily;
}
Set the font used by the program
//"DejaVu Sans Mono" This is one of the word libraries found by the last traversal
QFont font("DejaVu Sans Mono");
QApplication::setFont(font);
Add external font ttf To the system font
Because my program is in arm Executed under , So first we need to find font The path where the font is stored .
The path of my development board is /usr/lib/fonts . Put the word library under this path and give permission :chmod 777 xxx.ttf
following kacstOne It's my transplanted font
版权声明
本文为[Talent、me]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210610471764.html
边栏推荐
- [UDS unified diagnostic service] IV. typical diagnostic service (4) - online programming function unit (0x34-0x38)
- 硬核解析Promise對象(這七個必會的常用API和七個關鍵問題你都了解嗎?)
- Crawl the product data of Xiaomi Youpin app
- 软件测试总结
- Map basemap Library
- Gson fastjason Jackson of object to JSON difference modifies the field name
- C byte array (byte []) and string are converted to each other
- Excel opens large CSV format data
- re正則錶達式
- re正则表达式
猜你喜欢
硬核解析Promise對象(這七個必會的常用API和七個關鍵問題你都了解嗎?)
多功能工具箱微信小程序源码
[UDS unified diagnostic service] IV. typical diagnostic service (4) - online programming function unit (0x34-0x38)
Robocode Tutorial 4 - robocode's game physics
Docker 安裝 Redis
Re expression régulière
ArcGIS license error -15 solution
硬核解析Promise对象(这七个必会的常用API和七个关键问题你都了解吗?)
Nodejs installation
Differences between SSD hard disk SATA interface and m.2 interface (detailed summary)
随机推荐
Differences between SSD hard disk SATA interface and m.2 interface (detailed summary)
Format problems encountered in word typesetting
Auto. JS custom dialog box
消费者灰度实现思路
C language input and output (printf and scanf functions, putchar and getchar functions)
Data stream encryption and decryption of C
Matlab tips (6) comparison of seven filtering methods
线上怎么确定期货账户安全的?
Nodejs installation
Gson fastjason Jackson of object to JSON difference modifies the field name
Test post and login function
Docker 安装 Redis
idea中安装YapiUpload 插件将api接口上传到yapi文档上
QT reading and writing XML files (including source code + comments)
Read excel, int digital time to time
Nanotechnology + AI enabled proteomics | Luomi life technology completed nearly ten million US dollars of financing
Robocode Tutorial 4 - robocode's game physics
How to install jsonpath package
C language array processing batch data
Serialization scheme of serde - trust