The cross-compiled program cannot display the added fonts
-
Hello!
I ran into the following problem.
I cross-compiled Qt 5.15.2 to Rasperry Pi 4 and added some truetype fonts in the main function:QApplication app(argc, argv); qint32 fontId; fontId = QFontDatabase::addApplicationFont(":/res/fonts/SourceCodePro-Bold.ttf"); if (fontId > -1) qDebug() << QFontDatabase::applicationFontFamilies(fontId) << "added"; fontId = QFontDatabase::addApplicationFont(":/res/fonts/SourceCodePro-BoldIt.ttf"); if (fontId > -1) qDebug() << QFontDatabase::applicationFontFamilies(fontId) << "added"; fontId = QFontDatabase::addApplicationFont(":/res/fonts/SourceCodePro-It.ttf"); if (fontId > -1) qDebug() << QFontDatabase::applicationFontFamilies(fontId) << "added"; fontId = QFontDatabase::addApplicationFont(":/res/fonts/SourceCodePro-Regular.ttf"); if (fontId > -1) qDebug() << QFontDatabase::applicationFontFamilies(fontId) << "added"; app.setFont(QFont(QFontDatabase::applicationFontFamilies(fontId).at(0), 10));
The program is compiles and runs, it says on the output that the fonts are added, so the fontId is not -1, but everything is written in the program with the default DejaVu fonts.
When cross-compiling Qt, Freetype, Use system freeteype and Fontconfig were set to yes.
Thank you in advance for your help!
-
I might be a bit shooting in the dark here;
but is fontconfig the only component required? Or is there more?