Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos QFontInfo未返回正确的字体系列_Macos_Qt_Fonts - Fatal编程技术网

Macos QFontInfo未返回正确的字体系列

Macos QFontInfo未返回正确的字体系列,macos,qt,fonts,Macos,Qt,Fonts,我正在尝试使用苹果在雪豹上提供的一种只有盲文的字体,叫做苹果盲文,来模拟盲文显示 我正在尝试使用Qt4.7.3来完成这项工作,但到目前为止,我还没有成功地让它加载字体。查看下面的代码: #include <QCoreApplication> #include <QDebug> #include <QFontDatabase> #include <QFontInfo> #include <QStringList> Q_DECL_EXPO

我正在尝试使用苹果在雪豹上提供的一种只有盲文的字体,叫做
苹果盲文
,来模拟盲文显示

我正在尝试使用Qt4.7.3来完成这项工作,但到目前为止,我还没有成功地让它加载字体。查看下面的代码:

#include <QCoreApplication>
#include <QDebug>
#include <QFontDatabase>
#include <QFontInfo>
#include <QStringList>

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QCoreApplication> app(new QCoreApplication(argc, argv));

    int id = QFontDatabase::addApplicationFont(
        "/System/Library/Fonts/Apple Braille Outline 8 Dot.ttf");

    qDebug() << "Registered font Family is"
             << QFontDatabase::applicationFontFamilies(id).join(",");

    QFont desired_font("Apple Braille");

    qDebug() << "Got" << QFontInfo(desired_font).family();

    return app->exec();
}
#包括
#包括
#包括
#包括
#包括
Q_DECL_导出int main(int argc,char*argv[])
{
QScopedPointer应用程序(新的qcore应用程序(argc,argv));
int id=QFontDatabase::addApplicationFont(
“/System/Library/Fonts/Apple Braille Outline 8 Dot.ttf”);

qDebug()这在操作系统10.8.1和Qt4.8.2上适用-
获得了“苹果盲文”