I managed to build and boot the tisdk-default-image-am335x-evm using 07.03.00.005.
I run some of the qt demo apps that are packaged into that image, and it looks good to me.
I created a simple qtwidgets app (cross-compiling on the host with qtcreator).
Just a mainwindow and a button that has a large font.
The app runs on the target, except the large font on the button shows up as a very small font.
I checked /usr/share/fonts/ttf on target, the font I used in the gui is there.
I managed to get font and font size right for the target.
It's not a yocto or install problem, it's how to use qtcreator.
I'm not sure if it is the preferred method but it works for my case.
I include the font as a resource in the qtcreator project and load it at application init, as show in the link below.
https://amin-ahmadi.com/2016/01/07/embedding-fonts-in-your-qt-app/
So, no dealing with installing fonts on target system.
Related
I installed qt5 application (Mendeley Desktop) from here by using the instraller on windows10, and I don't like the default font; MS Gothic.
Is there some ways to change fonts in a qt5 application which I didn't build from source code?
Thanks in advance!
If they bundled the font into the application binary (via QRC), I'm afraid you can't.
Otherwise, you can check in the application installation folders if by any chance the font is loaded at runtime. In that case you just need to replace it (by keeping the original name) with your preferred one.
Same thing if they use the system font, but that would compromise all the other apps using MS Gothic.
Setting up Qt5.9 on my RaspberryPi3 with raspbian-lite version of image.
Next compile test application qtbase/examples/opengl/qopenglwidget
With run I can see next message
QFontDatabase: Cannot find font directory /usr/local/qt5pi/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
Application was running, but there is no any text.
I want to use standard fonts, but I don't now how I can do it.
OR, How to use FREE-Types from http://dejavu-fonts.org.
Please help me, somebody
I found right answer. It was very simple:
You must add any font (*.ttf) in-to directory /usr/local/qt5pi/lib/fonts on raspberryPi. For example, I use free fonts from
http://dejavu-fonts.org.
For some reason, I want to publish my application as a portable one. That is, avoiding the pre-installed shared libraries and use my own ones, shipped together with the app.
Long story short. Following the advises on this helpful page, I found that the window icon, which is an svg, not showing up in the foreign computer. What did I miss?
Turns out a shared library it needs cannot be found.
In Windows, you have to put Qt5Svg.dll in the same folder of the exe. And in Linux, besides the libQt5Svg.so.5, iconengines/libqsvgicon.so is also needed.
Just a thought: is there any resource somewhere with a list "safe-fonts" for a cross platform desktop Qt app that needs to run on windows, Mac and Linux (Ubuntu 10.* for instance).
and while we're on the subject, is there any way to "package" a font with the executable as part of the resources and have it run seamlessly in all three platforms?
I've never tried it but I think you can use addApplicationFont to load a font from a file. The file can be part of your app's resource.
I can't seem to work out how to enable icons in the AIR Debug Launcher. This seems to work on Linux, but when I run it on Windows or Mac only the Adobe AIR icon shows. I have specified the location of the icon in <icon></icon> in the application descriptor file.
Those icons are created from the file references in the application descriptor file when the application installs itself so you won't really be able to see them during development.
There is a solution available on Christian Cantrell's Adobe blog that works around this though the instructions are from February 2008. This may or may not work with the latest Flex SDK or Flex/Flash Builder IDE.
Fortunately, I’ve found an easy way to make this work. Here’s what you do:
Make a copy of your application icon and name it something different. One version should be referenced by your application descriptor file, and the other will be compiled into your application. (You don’t technically have to make a copy of the icon, but when generating a release build of your application, Flex Builder doesn’t copy over embedded resources which means your application icon will be missing. Trust me when I tell you that it’s easier to create a copy and avoid this whole issue.)
Compile the copy of your application icon into your application using code like this:
[Embed(source="assets/application.png")] public var appIconClass:Class;
In your application’s initialization code, create a Bitmap instance of your icon like this:
var appIcon:Bitmap = new appIconClass();
Set your icon like this:
InteractiveIcon(NativeApplication.nativeApplication.icon).bitmaps = [appIcon];
This code is a little oversimplified because it doesn’t take platform differences into account. A more complete implementation might do something like this:
Check to see what kinds of icons the client supports. You can do this with the NativeApplication.supportsDockIcon and NativeApplication.supportsSystemTrayIcon APIs.
Scale the Bitmap to the appropriate dimensions for the platform.
Set the icon(s) using the NativeApplication’s icon property.