Font changes not aplying
-
Did you check the returned id from addApplicationFont ?
-
wrote on 27 Mar 2016, 12:11 last edited by
@SGaist More or less, what I did to test that the font is working is this:
int id = QFontDatabase::addApplicationFont( "/usr/share/fonts/truetype/Open_Sans/OpenSans-Regular.ttf"); QString family = QFontDatabase::applicationFontFamilies(id).at(0); QFont monospace(family); qApp->setFont(monospace);
But it doesn't work.... No idea what can be happening
-
What is the value of id ?
-
Use the debugger then or a dummy widget.
-
@cxam said:
hi, just small question.
Since addApplicationFont dont return -1 for error, i wonder if he need to NEW the font as they talk about here
https://forum.qt.io/topic/23875/how-to-use-qfontdatabase-addapplicationfont
? -
@cxam said:
hi, just small question.
Since addApplicationFont dont return -1 for error, i wonder if he need to NEW the font as they talk about here
https://forum.qt.io/topic/23875/how-to-use-qfontdatabase-addapplicationfont
?wrote on 28 Mar 2016, 10:58 last edited by@mrjj said:
https://forum.qt.io/topic/23875/how-to-use-qfontdatabase-addapplicationfont
I think that's the answer to my problem but I'm unable to put it into my program, would you mind making it more explained for me please?
-
@cxam said:
hi, just small question.
Since addApplicationFont dont return -1 for error, i wonder if he need to NEW the font as they talk about here
https://forum.qt.io/topic/23875/how-to-use-qfontdatabase-addapplicationfont
? -
@cxam
so did it make any difference?
15/16