QT去哪里寻找字体? [英] where does QT go to look for fonts?
问题描述
在我的QT应用程序中有以下代码:
QFont newFont(wenquanyi,8,QFont :: Bold,true);
QApplication :: setFont(newFont);
但字符不能正确显示。在我的目标linux设备中,在 QT-directory / lib / fonts
下有一个 wenquanyi_150_50.qpf
文件。
如果我改变了这样的代码:
QFont newFont unifont,8,QFont :: Bold,true);
我可以看到正确显示的字符。
所以我在想这个问题是关于QT寻找特定字体的路径。
使用Qt for Embedded Linux时遇到类似这样的问题。看看这些:
- http://qt-project.org/doc/qt-4.8/qt-embedded-deployment.html
- http://qt-project.org/doc/ qt-4.8 / qt-embedded-fonts.html
并尝试使用 I'm using QT-4 embedded-linux. I have the following code in my QT application: But the character cannot be displayed correctly. I do have a If I changed the code like this: I can see the character being displayed correctly. So i'm thinking that the problem is the about the path in which QT looks for a specific fonts. I experienced issues like this when using Qt for Embedded Linux. Have a look at these: and also try to use QFontDatabase. I found it very useful to get a list of all the fonts actually detected by QWS and of their features. 这篇关于QT去哪里寻找字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!QFont newFont("wenquanyi", 8, QFont::Bold, true);
QApplication::setFont(newFont);
wenquanyi_150_50.qpf
file under QT-directory/lib/fonts
in my target linux device. QFont newFont("unifont", 8, QFont::Bold, true);