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 use custom Fonts

How to use custom Fonts

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 927 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.
  • BuccaneerB Offline
    BuccaneerB Offline
    Buccaneer
    wrote on last edited by
    #1

    I want to use a custom fonts not a from a system, (some.ttf)
    how can I do this?

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      You can use "QFontDatabase::addApplicationFont":http://qt-project.org/doc/qt-5/qfontdatabase.html#addApplicationFont. Just pass the .ttf file.

      157

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Robbin
        wrote on last edited by
        #3

        You can also use the Qt resource system and add your fonts as resource. Then you can pass the font resource location to QFontDatabase (e.g. ":/resources/some.ttf")

        1 Reply Last reply
        0
        • BuccaneerB Offline
          BuccaneerB Offline
          Buccaneer
          wrote on last edited by
          #4

          Thanks a lot. That's it

          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