Solved problem with font after deploys
-
sup guys, im relatively new working with Qt creator, i have the 4.3 version, and have this problem>
i make an app with a non standart window font, all the labels had this font,
now, after use minGW 5.3 windeployqt.exe, run the app in other pc and all the labels have another font, not the one i use in my pc.
someone can help me, i dont know what i doing wrong, thanks, sorry my english :) -
Hi and welcome to devnet,
Did you forget to deploy your font with your application ?
-
@SGaist said in problem with font after deploys:
y your
deploy my font__???? i dont know how to do that, can you explain me_?
-
First thing: where does the font you use come from ?
-
i rightclicked the labels, - styleSheets, - addfont, from there i select the font, so the font may come from the window's system folder
-
Are you sure it's a system font ?
What name is it ? -
is not a default system font, i download the font , and paste in the font system folder, the name of the font is Usuziv2, i use it in my application, then i deploy it, and when i run my app in another pc tha application load another font, thats my problem
-
You have to distribute that font alongside your application but you must first check that it's allowed by the font author.
As for the distribution, you can use Qt's resources system.
-
@SGaist
now i added the font to a resource file that i create, but dont know how to set te font from the resource file to the label -
QFontDatabase is the best place to handle fonts.
-
@SGaist said in problem with font after deploys:
e best place to h
solved
first add the font to the .qrc file, and then this line>
QFontDatabase::addApplicationFont(“:/fonts/fontName.ttf”);
and the labels with font: xpx, "fontName";thanks
-
You're welcome !
Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)