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
QtWS25 Last Chance

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
  • 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.
  • E Offline
    E Offline
    Emrecp
    wrote on 15 Feb 2021, 18:17 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 15 Feb 2021, 19:04 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

      E 2 Replies Last reply 16 Feb 2021, 07:12
      1
      • S SGaist
        15 Feb 2021, 19:04

        Hi,

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

        E Offline
        E Offline
        Emrecp
        wrote on 16 Feb 2021, 07:12 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
        • S SGaist
          15 Feb 2021, 19:04

          Hi,

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

          E Offline
          E Offline
          Emrecp
          wrote on 16 Feb 2021, 07:57 last edited by
          #4

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

          J 1 Reply Last reply 16 Feb 2021, 08:14
          0
          • E Emrecp
            16 Feb 2021, 07:57

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

            J Offline
            J Offline
            JKSH
            Moderators
            wrote on 16 Feb 2021, 08:14 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

            E 1 Reply Last reply 16 Feb 2021, 08:34
            2
            • J JKSH
              16 Feb 2021, 08:14
              • 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?
              E Offline
              E Offline
              Emrecp
              wrote on 16 Feb 2021, 08:34 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.

              J 1 Reply Last reply 16 Feb 2021, 14:09
              0
              • E Emrecp
                16 Feb 2021, 08:34

                @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.

                J Offline
                J Offline
                JKSH
                Moderators
                wrote on 16 Feb 2021, 14:09 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

                E 1 Reply Last reply 16 Feb 2021, 16:54
                3
                • J JKSH
                  16 Feb 2021, 14:09

                  @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?

                  E Offline
                  E Offline
                  Emrecp
                  wrote on 16 Feb 2021, 16:54 last edited by Emrecp
                  #8

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

                  1 Reply Last reply
                  0

                  7/8

                  16 Feb 2021, 14:09

                  • Login

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