Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to register fonts in Mac OS

How to register fonts in Mac OS

Scheduled Pinned Locked Moved General and Desktop
11 Posts 2 Posters 4.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    phamvanan
    wrote on 17 Jun 2013, 07:11 last edited by
    #1

    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.

    -PVA-

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 17 Jun 2013, 09:27 last edited by
      #2

      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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        phamvanan
        wrote on 17 Jun 2013, 09:39 last edited by
        #3

        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&#40;&#41;;
        

        }
        @
        outputs is result: 0
        But i check fonts folder system not found.
        I try to test on Window OS.
        Thanks,
        An.

        -PVA-

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 17 Jun 2013, 09:45 last edited by
          #4

          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.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            phamvanan
            wrote on 17 Jun 2013, 09:52 last edited by
            #5

            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.

            -PVA-

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 17 Jun 2013, 10:08 last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • P Offline
                P Offline
                phamvanan
                wrote on 17 Jun 2013, 10:28 last edited by
                #7

                Not install new fonts when using Qt for Window and Mac OS, is it right?
                Thank you very much.
                An.

                -PVA-

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 17 Jun 2013, 10:32 last edited by
                  #8

                  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.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    phamvanan
                    wrote on 17 Jun 2013, 10:41 last edited by
                    #9

                    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.

                    -PVA-

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 17 Jun 2013, 11:42 last edited by
                      #10

                      You have to use system specific solutions to do that

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        phamvanan
                        wrote on 18 Jun 2013, 06:25 last edited by
                        #11

                        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.

                        -PVA-

                        1 Reply Last reply
                        0

                        10/11

                        17 Jun 2013, 11:42

                        • Login

                        • Login or register to search.
                        10 out of 11
                        • First post
                          10/11
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved