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-4UAwDid not work for me. What am I doing wrong?
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.
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
-
-
Right click on the sub folder with the same name as the Project name. Select "Add New"
! -
Select QML files, Font Loader
Select -
Enter any name for "component name", e.g. "Comic".
For "Font" segment, browse directly to where the font is located. Click "finished"
-
"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"
-
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"
-
In the Designer's Text Editor tab, select a Qt text object, add the line "font.family: Constants.font.family" to it
-
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.
!
-