How to register fonts in Mac OS
-
For Qt you can use QFontDatabase, but if you register the font with the system you won't need it.
A quick google search returns "this":http://www.guidingtech.com/6437/how-to-install-new-fonts-in-mac-os-x/ for font installation
-
Hi, I try to use QFontDatabase:
@#include <QtGui/QApplication>
#include <QFontDatabase>
#include <QDebug>
#include "mainwindow.h"int main(int argc, char *argv[])
{
QApplication a(argc, argv);
int kq = QFontDatabase::addApplicationFont("C:/src/Hawaii_Killer.ttf");
qDebug()<<"result: "<<kq;
MainWindow w;
w.show();return a.exec();
}
@
outputs is result: 0
But i check fonts folder system not found.
I try to test on Window OS.
Thanks,
An. -
Windows and OS X font management are not the same.
Why would 0 be a wrong value ? From the doc addApplicationFont returns -1 if the font could not be loaded.
-
Then use the tools provided by your OS, Qt won't install system fonts for you.
Search for "install font windows" for example. This will get you the Microsoft guide to do it.
-
I don't understand your last question.
With Qt you can use a custom font within your app loaded for it or any of the font already installed. BUT you cannot install new fonts in the system with it out of the box.
-
You have to use system specific solutions to do that