如何在Windows Qt中使用Linux字体? [英] How to use linux fonts in windows Qt?
问题描述
您可以使用 QFontDatabase :: addApplicationFont 从文件或内存中加载字体(的QByteArray )。返回的ID可用于检索字体系列列表(请参阅QFontDatabase :: applicationFontFamilies < a>)可以传递给QFontDatabase :: 字体创建一个 QFont 在您的应用程序中使用的对象。
<仅支持 TrueType 字体。
We develop an embedded Qt application for linux on MS Windows. The target platform is linux without X-windows (framebuffer). Unfortunallety, the screens on windows look rather different (better) than the same screens on linux because windows has better fonts. Is there a way to force Qt on windows to use the linux fonts? I would like to achieve binary compatibility i.e. CRCs of the screenshots will be the same in linux and in windows.
You can use QFontDatabase::addApplicationFont to load a font from a file or from memory (QByteArray). The returned id can be used to retrieve a list of font families (see QFontDatabase::applicationFontFamilies) that can be passed to QFontDatabase::font to create a QFont object for use in your application.
Only TrueType fonts are supported.
这篇关于如何在Windows Qt中使用Linux字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!