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. Custom Font Doesn't looks like Same on Qt
Forum Updated to NodeBB v4.3 + New Features

Custom Font Doesn't looks like Same on Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
fontcustom fontfigma
8 Posts 3 Posters 1.1k Views 2 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.
  • EmrecpE Offline
    EmrecpE Offline
    Emrecp
    wrote on last edited by
    #1

    Hi,
    I am using Custom Font: Exo2 SemiBold
    When I try to use this font on my QT project, it doesn't look like same with originally (in Figma, WordPad)

    My Font:
    WeTransfer Link

    EXO2.png

    Figma:
    Figma.png

    My code:

    QFontDatabase.applicationFontFamilies(QFontDatabase.addApplicationFont(":/source/img/f_Exo2_SemiBold.otf"))
    self.FONT_EXO_12 = QFont("Exo 2 Semi Bold", 12)
    self.FONT_EXO_12_2= QFont('Exo2', 12) # both doesn't look like same as on Figma
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you check that you are getting the exact font you are requesting ?

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

      EmrecpE 2 Replies Last reply
      1
      • SGaistS SGaist

        Hi,

        Did you check that you are getting the exact font you are requesting ?

        EmrecpE Offline
        EmrecpE Offline
        Emrecp
        wrote on last edited by
        #3

        @SGaist I am not sure, i tried download this font from 3 different websites. Both of them are same.

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Did you check that you are getting the exact font you are requesting ?

          EmrecpE Offline
          EmrecpE Offline
          Emrecp
          wrote on last edited by
          #4

          @SGaist But as you can see in WordPad, this font in WordPad, looks like in Figma.

          JKSHJ 1 Reply Last reply
          0
          • EmrecpE Emrecp

            @SGaist But as you can see in WordPad, this font in WordPad, looks like in Figma.

            JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by
            #5
            • What is the value returned by QFontDatabase.addApplicationFont()? (It returns -1 if it failed to load the font)
            • Print the list that is returned by QFontDatabase.applicationFontFamilies() -- Is your custom font available in the list?

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            EmrecpE 1 Reply Last reply
            2
            • JKSHJ JKSH
              • What is the value returned by QFontDatabase.addApplicationFont()? (It returns -1 if it failed to load the font)
              • Print the list that is returned by QFontDatabase.applicationFontFamilies() -- Is your custom font available in the list?
              EmrecpE Offline
              EmrecpE Offline
              Emrecp
              wrote on last edited by
              #6

              @JKSH

              addf = QFontDatabase.addApplicationFont(":/source/img/f_Exo2_SemiBold.otf") # returns 0
              self.fontName= QFontDatabase.applicationFontFamilies(addf)
              print(self.fontName) # ['Exo 2 Semi Bold']
              

              Still looks like same.

              JKSHJ 1 Reply Last reply
              0
              • EmrecpE Emrecp

                @JKSH

                addf = QFontDatabase.addApplicationFont(":/source/img/f_Exo2_SemiBold.otf") # returns 0
                self.fontName= QFontDatabase.applicationFontFamilies(addf)
                print(self.fontName) # ['Exo 2 Semi Bold']
                

                Still looks like same.

                JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #7

                @Emrecp said in Custom Font Doesn't looks like Same on Qt:

                Still looks like same.

                I had a closer look at your screenshots.

                • Your Qt app's rendering of "Origin" looks very similar to Wordpad's rendering of "Origin"
                • Your Qt app's rendering of "Oyunu Başlat" looks very similar to Figma's rendering of "Oyunu Başlat".

                What is the problem?

                self.FONT_EXO_12 = QFont("Exo 2 Semi Bold", 12)
                

                How does it look when you use font size 72 instead of 12?

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                EmrecpE 1 Reply Last reply
                3
                • JKSHJ JKSH

                  @Emrecp said in Custom Font Doesn't looks like Same on Qt:

                  Still looks like same.

                  I had a closer look at your screenshots.

                  • Your Qt app's rendering of "Origin" looks very similar to Wordpad's rendering of "Origin"
                  • Your Qt app's rendering of "Oyunu Başlat" looks very similar to Figma's rendering of "Oyunu Başlat".

                  What is the problem?

                  self.FONT_EXO_12 = QFont("Exo 2 Semi Bold", 12)
                  

                  How does it look when you use font size 72 instead of 12?

                  EmrecpE Offline
                  EmrecpE Offline
                  Emrecp
                  wrote on last edited by Emrecp
                  #8

                  @JKSH Now looks like very similar. Thanks everyone for help :)

                  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