How to add font into Qt Design Studio 1.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. 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 !
    1. Select QML files, Font Loader
      0_1553504824870_35831f6c-fbea-4ab1-a488-626b07c31d32-image.png Select
    1. 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
    1. "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
    1. 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
    1. 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
    1. 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 !

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.