Optionally bundle font.
This commit is contained in:
parent
49ab6684e3
commit
d1186ea810
|
@ -17,7 +17,7 @@ before_build:
|
|||
- git submodule update --init --recursive
|
||||
|
||||
build_script:
|
||||
- qmake spectral.pro CONFIG+=release CONFIG+=qtquickcompiler PREFIX="%DEPLOY_DIR%"
|
||||
- qmake spectral.pro CONFIG+=release CONFIG+=qtquickcompiler BUNDLE_FONT=true PREFIX="%DEPLOY_DIR%"
|
||||
- nmake
|
||||
|
||||
after_build:
|
||||
|
@ -27,4 +27,4 @@ after_build:
|
|||
|
||||
artifacts:
|
||||
- path: spectral.zip
|
||||
name: portable
|
||||
name: portable
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,6 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>assets/font/roboto.ttf</file>
|
||||
<file>assets/font/twemoji.ttf</file>
|
||||
</qresource>
|
||||
</RCC>
|
13
spectral.pro
13
spectral.pro
|
@ -20,6 +20,9 @@ isEmpty(USE_SYSTEM_SORTFILTERPROXYMODEL) {
|
|||
isEmpty(USE_SYSTEM_QMATRIXCLIENT) {
|
||||
USE_SYSTEM_QMATRIXCLIENT = false
|
||||
}
|
||||
isEmpty(BUNDLE_FONT) {
|
||||
BUNDLE_FONT = false
|
||||
}
|
||||
|
||||
$$USE_SYSTEM_QMATRIXCLIENT {
|
||||
PKGCONFIG += QMatrixClient
|
||||
|
@ -45,8 +48,14 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
|||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
RESOURCES += \
|
||||
res.qrc
|
||||
RESOURCES += res.qrc
|
||||
$$BUNDLE_FONT {
|
||||
message("Bundling fonts.")
|
||||
DEFINES += BUNDLE_FONT
|
||||
RESOURCES += font.qrc
|
||||
} else {
|
||||
message("Using fonts from operating system.")
|
||||
}
|
||||
|
||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||
QML_IMPORT_PATH += imports/
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <QFontDatabase>
|
||||
#include <QGuiApplication>
|
||||
#include <QNetworkProxy>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
@ -61,6 +62,11 @@ int main(int argc, char *argv[]) {
|
|||
qRegisterMetaType<SpectralRoom *>("SpectralRoom*");
|
||||
qRegisterMetaType<SpectralUser *>("SpectralUser*");
|
||||
|
||||
#if defined(BUNDLE_FONT)
|
||||
QFontDatabase::addApplicationFont(":/assets/font/roboto.ttf");
|
||||
QFontDatabase::addApplicationFont(":/assets/font/twemoji.ttf");
|
||||
#endif
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
engine.addImportPath("qrc:/imports");
|
||||
|
|
Loading…
Reference in New Issue