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 add font into Qt Design Studio 1.1
QtWS25 Last Chance

How to add font into Qt Design Studio 1.1

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 2.9k 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.
  • T Offline
    T Offline
    Thug
    wrote on 15 Mar 2019, 07:27 last edited by Thug
    #1

    Hi,

    In Qt Design Studio 1.1, there is only 5 fonts. I tried to add more by following this video
    https://www.youtube.com/watch?v=Z3uPoe-4UAw

    Did not work for me. What am I doing wrong?

    0_1552634416997_add font.png

    In the .ui file (screenshot below) it seem to auto complete Roboto{}, but I can't select it in the font drop down list, as shown in 1st screenshot.

    0_1552634513659_e9685908-5784-4059-af1b-3dfe1f3e082f-image.png

    Did I put the roboto.qml file in the wrong folder? Have been trying to add a font for the past 3 hours?

    In Qt Creator, there is no such problem.

    Rgds

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Thug
      wrote on 25 Mar 2019, 09:20 last edited by Thug
      #2
      1. Right click on the sub folder with the same name as the Project name. Select "Add New"
        0_1553505468009_081a9549-0c38-4551-997c-6bf3e8fc935b-image.png !

      2. Select QML files, Font Loader
        0_1553504824870_35831f6c-fbea-4ab1-a488-626b07c31d32-image.png Select

      3. Enter any name for "component name", e.g. "Comic".
        For "Font" segment, browse directly to where the font is located. Click "finished"
        0_1553504906623_b9602156-69be-4d39-9d2c-eefdcf7fb0ae-image.png

      4. "Comic.qml" file will be create in the sub folder. Open it to see what is the source name of the font. E.g. "comic.ttf"
        0_1553506902871_cfbfb00f-1565-4a83-8e86-5146cc2557a5-image.png

      5. Edit the file "Constraints.qml". Edit the line highlighted. I named it "comicFont", source name "comic.ttf"
        For the subsequent 2 lines where the name "mySystemFont" is used, change it to "comicFont"
        0_1553505053469_9c3e2e64-8580-46fe-8c3a-40888dc1683c-image.png

      6. In the Designer's Text Editor tab, select a Qt text object, add the line "font.family: Constants.font.family" to it
        0_1553505239891_9075dd7d-9e9e-458a-b817-1bcd682f64c4-image.png

      7. In Designer Form Editor tab view, your font should become "Comic Sans"
        At the "Navigator, Properties" tab, under "Font", you should also see "Comic Sans MS" displayed.
        But it is un-selectable in the drop down list.
        0_1553505344073_7d1dc679-4780-4e37-9994-0dda2eee99b9-image.png !

      1 Reply Last reply
      2

      • Login

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