QT中使用fontawesome-webfont.ttf字体库
fontawesome-webfont.ttf
http://www.fontawesome.com.cn/cheatsheet/
参考链接1
https://github.com/Gamecreature/qtawesome
QtAwesome - Font Awesome support for Qt applications
QtAwesome is a simple library that can be used to add Font Awesome icons to your Qt application.
NOTE: Though the name is QtAwesome and currently it’s very Font Awesome based, you can use every other icon/glyph font you want.
The class can also be used to manage your own dynamic code-drawn icons, by adding named icon-painters.
Updated to FontAwesome 4.7.0
Installation
The easiest way to include QtAweome in your project is to copy the QtAwesome directory to your project tree and add the following include() to your Qt project file:
include(QtAwesome/QtAwesome.pri)
Now you are good to go!
You probably want to create a single QtAwesome object for your whole application:
QtAwesome* awesome = new QtAwesome( qApp )
awesome->initFontAwesome(); // This line is important as it loads the font and initializes the named icon map
Add an accessor to this object (i.e. a global function, member of your application object, or whatever you like).
Use an icon name from the Font Awesome Cheatsheet.
https://fontawesome.com/cheatsheet
参考链接2
如何将 Font Awesome 转成 PNG 图标 详细教程 含源代码
https://blog.csdn.net/weixin_30511107/article/details/99010841
font-awesome-to-png.py
参考链接3
icon-font-to-png-master
https://github.com/Pythonity/icon-font-to-png
另外一个
https://github.com/Pythonity/font-awesome-to-png
Examples
Export the “play” and “stop” icons as 24x24 pixels images:
font-awesome-to-png.py --size 24 play stop
Export the asterisk icon as 32x32 pixels image, in blue:
font-awesome-to-png.py --size 32 --color blue asterisk
Export all icons as 16x16 pixels images:
font-awesome-to-png.py ALL
链接5
https://fontawesome.com/v4.7.0/cheatsheet/
https://fontawesome.com/v4.7.0/icons/
font-awesome-to-png\Font-Awesome-4.7.0\css
font-awesome.css
Font-Awesome-4.7.0\fonts
fontawesome-webfont.ttf
3、使用举例:我们想加载一个“咖啡”图标:
首先在font-awesome.css文件中查找其编码,这是我们程序中需要使用的:
fa-search-plus []
fa-heart []
1、fontawesome-webfont.ttf字体库中包含了很多图标,
每个图标都对应一个编码,
所以我们通过字体编码来加载所需要的图标。
2、字体库的下载地址:http://www.bootcss.com/p/font-awesome/。
下载完成后我们找到fontawesome-webfont.ttf文件,
他是我们需要的字体库,我们可以将字体库加载到资源中引用;
找到font-awesome.css文件,它是查找每个图标所对应的编码所需要的,
一个更快捷的查找图标编码的方式是:快捷查找图标所对应的编码。
font awesome字体是一款非常美观的字体
这两种不同