Solved Increase font size on target board using Qt for Embedded Linux
-
Hi, I'm developing with Qt for Embedded Linux and Qt 4.7.1 on Linux and I'm cross compiling for an ARM board with Digi som. On the Qt application that runs on the ARM board using Digi ESP for embedded Linux, I need some QLabels with large fonts (I set to 48pt on the QtDesigner), but when I load the executable on the ARM board those fonts are not as large as I see them on the QtDesigner interface (and on my Linux PC), and even if I set a bigger font size, when I run the application on the board, the fonts have always the same size (as if it were reached a maximum font size or as if the font does not support that size).
I have tried everything from makeqpf (which does not compile) to build qt with freetype but nothing seems to work and I need some urgent help with this.
-
Hi and welcome to devnet,
You can also set the font size of your widget directly in your code.
QFont font = ui->myLabel->font(); font.setPointSize(48); ui->myLabel->setFont(font);
Note that Qt 4.7.1 is pretty outdate so if you can't migrate to Qt 5, consider to move to 4.8.7
-
Hi, thank you for the reply. My code currently states the fontsize is set to 48. (font.setPointSize(48)). But the target is not able to display a 48 font size. The maximum it displays is 24. Has it got to do with the fact that my target's qt/lib/fonts folder has Helvetica_240_80.qpf as the largest font, which is why the font size does not go beyond 24? If so, how do I fix that? I am thinking about migrating to Qt 4.8.
-
You can use makeqpf to generate the font files you need.
See here for more information about Qt Embedded fonts.
-
Like I previously mentioned in my question, my makeqpf does not compile. It fails to run on my host linux x86 pc (since the binary is arm). Hence I am not able to use that tool for creating qpf fonts. I have searched everything on the internet for makeqpf tool and also built Qt with freetype to support Truetype fonts, but with no luck.
-
Doesn't build and doesn't run are not the same thing.
Build it with your desktop Qt.
-
I set the environment variable called "QWS_DISPLAY" on my target board with the correct width and height and that solved the font problem. Thank you for helping me!
-
Glad you found out and thanks for sharing.
Since you have it working now, please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)