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. Embedded TTF does not work in QT5 for Linux GUI application.
Forum Updated to NodeBB v4.3 + New Features

Embedded TTF does not work in QT5 for Linux GUI application.

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 5 Posters 828 Views 3 Watching
  • 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.
  • L Offline
    L Offline
    LostDeveloper
    wrote on 27 Jun 2019, 10:19 last edited by
    #1

    Hi,
    I got problem with using my own TTF for my application.
    I installed libfontconfig-dev and all its dependencies.
    The QFontDatabase::addApplicationFont(<path of font-family>) function returns success but when I use my font-family in setFont(QFont(font-family)) nothing happens. The font-family is not reflected.

    Your inputs are greatly appreciated :)

    R 1 Reply Last reply 27 Jun 2019, 11:47
    0
    • L LostDeveloper
      27 Jun 2019, 10:19

      Hi,
      I got problem with using my own TTF for my application.
      I installed libfontconfig-dev and all its dependencies.
      The QFontDatabase::addApplicationFont(<path of font-family>) function returns success but when I use my font-family in setFont(QFont(font-family)) nothing happens. The font-family is not reflected.

      Your inputs are greatly appreciated :)

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 27 Jun 2019, 11:47 last edited by
      #2

      @LostDeveloper
      does the following return what you expect?

      qDebug() << QFontDatabase::applicationFontFamilies( QFontDatabase::addApplicationFont(...) );
      

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      L 2 Replies Last reply 28 Jun 2019, 02:54
      4
      • R raven-worx
        27 Jun 2019, 11:47

        @LostDeveloper
        does the following return what you expect?

        qDebug() << QFontDatabase::applicationFontFamilies( QFontDatabase::addApplicationFont(...) );
        
        L Offline
        L Offline
        LostDeveloper
        wrote on 28 Jun 2019, 02:54 last edited by
        #3

        @raven-worx I will try that.

        I did this yesterday too..

        //QFontDatabase db;
            for(int i=0; i<db.families().size(); i++)
            {
            qDebug() << db.families().at(i);
            }```
        //
        But my font-family is not listed.```
        
        1 Reply Last reply
        0
        • R raven-worx
          27 Jun 2019, 11:47

          @LostDeveloper
          does the following return what you expect?

          qDebug() << QFontDatabase::applicationFontFamilies( QFontDatabase::addApplicationFont(...) );
          
          L Offline
          L Offline
          LostDeveloper
          wrote on 28 Jun 2019, 03:17 last edited by
          #4

          @raven-worx said in Embedded TTF does not work in QT5 for Linux GUI application.:

          @LostDeveloper
          does the following return what you expect?

          qDebug() << QFontDatabase::applicationFontFamilies( QFontDatabase::addApplicationFont(...) );
          

          This returns "( )".

          1 Reply Last reply
          0
          • L Offline
            L Offline
            LostDeveloper
            wrote on 28 Jun 2019, 05:53 last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • L Offline
              L Offline
              LostDeveloper
              wrote on 1 Jul 2019, 02:56 last edited by
              #6

              I already made it work.. thanks anyway.

              J K 2 Replies Last reply 1 Jul 2019, 04:41
              0
              • L LostDeveloper
                1 Jul 2019, 02:56

                I already made it work.. thanks anyway.

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 1 Jul 2019, 04:41 last edited by
                #7

                @LostDeveloper Please mark this topic as solved if it is solved.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 1 Jul 2019, 07:00 last edited by
                  #8

                  Hi,

                  How did you make it work ? It might be useful for other people getting the same issue as you.

                  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
                  1
                  • L LostDeveloper
                    1 Jul 2019, 02:56

                    I already made it work.. thanks anyway.

                    K Offline
                    K Offline
                    Kutyus
                    wrote on 9 Jan 2023, 19:52 last edited by
                    #9

                    @LostDeveloper Hi! I have the same problem, please share the solution with us

                    1 Reply Last reply
                    0

                    • Login

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