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.

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 5 Posters 1.4k 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.
  • LostDeveloperL Offline
    LostDeveloperL Offline
    LostDeveloper
    wrote on 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 :)

    raven-worxR 1 Reply Last reply
    0
    • LostDeveloperL LostDeveloper

      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 :)

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on 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

      LostDeveloperL 2 Replies Last reply
      4
      • raven-worxR raven-worx

        @LostDeveloper
        does the following return what you expect?

        qDebug() << QFontDatabase::applicationFontFamilies( QFontDatabase::addApplicationFont(...) );
        
        LostDeveloperL Offline
        LostDeveloperL Offline
        LostDeveloper
        wrote on 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
        • raven-worxR raven-worx

          @LostDeveloper
          does the following return what you expect?

          qDebug() << QFontDatabase::applicationFontFamilies( QFontDatabase::addApplicationFont(...) );
          
          LostDeveloperL Offline
          LostDeveloperL Offline
          LostDeveloper
          wrote on 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
          • LostDeveloperL Offline
            LostDeveloperL Offline
            LostDeveloper
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • LostDeveloperL Offline
              LostDeveloperL Offline
              LostDeveloper
              wrote on last edited by
              #6

              I already made it work.. thanks anyway.

              jsulmJ KutyusK 2 Replies Last reply
              0
              • LostDeveloperL LostDeveloper

                I already made it work.. thanks anyway.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on 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
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 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
                  • LostDeveloperL LostDeveloper

                    I already made it work.. thanks anyway.

                    KutyusK Offline
                    KutyusK Offline
                    Kutyus
                    wrote on 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