Bug 6830 - Qt5: no fonts are installed
Summary: Qt5: no fonts are installed
Status: VERIFIED INVALID
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2014.02
Hardware: PC Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-01 00:46 UTC by syntheticpp
Modified: 2016-03-18 13:30 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description syntheticpp 2014-02-01 00:46:31 UTC
Qt5 was build with linuxfb only and widgets, fontconfig enabled, but /output/target/usr/lib/font is empty.
Comment 1 Thomas Petazzoni 2014-02-01 08:50:14 UTC
Interesting. We do have some code that should install fonts to the target directory, when Qt has installed them to the staging directory. From qt5base.mk:

define QT5BASE_INSTALL_TARGET_FONTS
        if [ -d $(STAGING_DIR)/usr/lib/fonts/ ] ; then \
                mkdir -p $(TARGET_DIR)/usr/lib/fonts ; \
                cp -dpfr $(STAGING_DIR)/usr/lib/fonts/* $(TARGET_DIR)/usr/lib/fonts ; \
        fi
endef

So maybe the specific configuration you're using does not install fonts to the staging directory.

Can you post your Buildroot .config file?
Comment 2 syntheticpp 2014-02-01 11:57:47 UTC
Seems -fontconfig disables font installation:

$cat qtbase/mkspecs/features/qpa/genericunixfontdatabase.prf
CONFIG += qpa/basicunixfontdatabase
contains(QT_CONFIG, fontconfig) {
    DEFINES += Q_FONTCONFIGDATABASE
    LIBS += -lfontconfig
} else:!android {
    fonts.path = $$[QT_INSTALL_LIBS]/fonts
    fonts.files = $$QT_SOURCE_TREE/lib/fonts/*
    INSTALLS += fonts
}
Comment 3 syntheticpp 2014-02-01 15:31:55 UTC
I also don't build freetype now, but have not tested if it's a requirement.

Overall, it's more a question of documentation.
Comment 4 Alexey Brodkin 2016-03-18 13:30:38 UTC
Indeed with BR2_PACKAGE_QT5BASE_FONTCONFIG selected no fonts are installed in staging and essentially they won't get on target.

Moreover even if one puts fonts in /usr/lib/fonts on target they won't appear in Qt5 apps.

So I had to rebuild entire Qt5 after I disabled BR2_PACKAGE_QT5BASE_FONTCONFIG and fonts appeared in Qt apps.