How to register fonts in Mac OS
-
wrote on 17 Jun 2013, 07:11 last edited by
Hi all,
I have a problem about install fonts on Mac OS. I have copied new font files to font folder system.
How to register for system detect that new fonts. In Qt framework, how to implement that?
Thanks any for help.
An. -
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
-
wrote on 17 Jun 2013, 09:39 last edited by
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.
-
wrote on 17 Jun 2013, 09:52 last edited by
I want add a new font to window system.
I try to use QFontDatabase but it's not add. I open control panel and check fonts folder. it's not visible.
Please tell me reason and resolve.
Thanks.
An. -
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.
-
wrote on 17 Jun 2013, 10:28 last edited by
Not install new fonts when using Qt for Window and Mac OS, is it right?
Thank you very much.
An. -
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.
-
wrote on 17 Jun 2013, 10:41 last edited by
Hi,
My app is copy fonts files to window and mac system using Qt framework.
I don't know. Can Qt support to do it? If capacity how to do that?
An. -
You have to use system specific solutions to do that
-
wrote on 18 Jun 2013, 06:25 last edited by
Thank you for your answer,
As me know, Qt support building a plugin for platforms.
I hope Qt add new feature install font in next version.
An.
10/11