1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-25 12:13:00 +01:00

Move fonts into dedicated big qrc

This commit is contained in:
Elias Steurer 2021-05-09 12:45:14 +02:00
parent 2c8a0450bf
commit 103348c1ca
4 changed files with 28 additions and 24 deletions

View File

@ -76,13 +76,15 @@ set(l10n
set_source_files_properties(${l10n} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/translations")
qt5_add_translation(qmFiles ${l10n})
qt5_add_big_resources(fonts fonts.qrc)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
qt5_add_resources(qml qml.qrc Resources.qrc)
qt5_add_resources(qml qml.qrc assets.qrc)
else()
qtquick_compiler_add_resources(qml qml.qrc Resources.qrc)
qtquick_compiler_add_resources(qml qml.qrc assets.qrc)
endif()
add_executable(${PROJECT_NAME} ${src} ${headers} ${resources} ${qml})
add_executable(${PROJECT_NAME} ${src} ${headers} ${resources} ${qml} ${fonts})
if(APPLE)
#set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE true)
@ -105,11 +107,13 @@ if(WIN32)
configure_file(${VCPKG_INSTALLED_PATH}/tools/sentry-native/crashpad_handler.exe ${CMAKE_BINARY_DIR}/bin/ COPYONLY)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/assets/fonts)
configure_file(assets/fonts/NotoSansCJKkr-Regular.otf ${CMAKE_BINARY_DIR}/bin/assets/fonts COPYONLY)
endif()
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/assets/fonts)
configure_file(assets/fonts/NotoSansCJKkr-Regular.otf ${CMAKE_BINARY_DIR}/bin/assets/fonts COPYONLY)
target_compile_definitions(${PROJECT_NAME} PRIVATE "GIT_VERSION=${GIT_VERSION}")
target_link_libraries(

View File

@ -70,9 +70,7 @@ App::App()
QFontDatabase::addApplicationFont(":/assets/fonts/NotoSans-Medium.ttf");
QFontDatabase::addApplicationFont(":/assets/fonts/NotoSans-Light.ttf");
if (-1 == QFontDatabase::addApplicationFont(QGuiApplication::applicationDirPath() + "/assets/fonts/NotoSansCJKkr-Regular.otf")) {
qWarning() << "Could not load korean font from: " << QGuiApplication::applicationDirPath() + "/assets/fonts/NotoSansCJKkr-Regular.otf";
}
QFontDatabase::addApplicationFont(":/assets/fonts/NotoSansCJKkr-Regular.otf");
QQuickWindow::setTextRenderType(QQuickWindow::TextRenderType::NativeTextRendering);
@ -224,14 +222,13 @@ bool App::loadSteamPlugin()
isDebug = false;
#endif
#ifdef Q_OS_MACOS
const QString fileSuffix = isDebug ? "d.dylib" : ".dylib";
const QString fileSuffix = isDebug ? "d.dylib" : ".dylib";
m_workshopPlugin.setFileName(QApplication::applicationDirPath() + "/libScreenPlayWorkshop" + fileSuffix);
#endif
#ifdef Q_OS_WIN
const QString fileSuffix = isDebug ? "d.dll" : ".dll";
const QString fileSuffix = isDebug ? "d.dll" : ".dll";
m_workshopPlugin.setFileName(QApplication::applicationDirPath() + "/ScreenPlayWorkshop" + fileSuffix);
#endif
@ -239,11 +236,9 @@ bool App::loadSteamPlugin()
const QString fileSuffix = ".so";
#endif
if (!m_workshopPlugin.load()) {
qWarning() << "Steam plugin not provided!" << QApplication::applicationDirPath() + "/ScreenPlayWorkshop" + fileSuffix;
qWarning() << m_workshopPlugin.fileName() << " - With error: " << m_workshopPlugin.errorString() << " debug: " << isDebug;
qWarning() << m_workshopPlugin.fileName() << " - With error: " << m_workshopPlugin.errorString() << " debug: " << isDebug;
return false;
}

View File

@ -1,16 +1,6 @@
<RCC>
<qresource prefix="/">
<file>assets/WorkshopPreview.html</file>
<file>assets/fonts/LibreBaskerville-Italic.ttf</file>
<file>assets/fonts/NotoSans-Light.ttf</file>
<file>assets/fonts/NotoSans-Medium.ttf</file>
<file>assets/fonts/NotoSans-Regular.ttf</file>
<file>assets/fonts/NotoSans-Thin.ttf</file>
<file>assets/fonts/Roboto-Light.ttf</file>
<file>assets/fonts/Roboto-Regular.ttf</file>
<file>assets/fonts/Roboto-Thin.ttf</file>
<file>assets/fonts/RobotoMono-Light.ttf</file>
<file>assets/fonts/RobotoMono-Thin.ttf</file>
<file>assets/icons/app.ico</file>
<file>assets/icons/brand_github.svg</file>
<file>assets/icons/brand_gitlab.svg</file>

15
ScreenPlay/fonts.qrc Normal file
View File

@ -0,0 +1,15 @@
<RCC>
<qresource prefix="/">
<file>assets/fonts/LibreBaskerville-Italic.ttf</file>
<file>assets/fonts/NotoSans-Light.ttf</file>
<file>assets/fonts/NotoSans-Medium.ttf</file>
<file>assets/fonts/NotoSans-Regular.ttf</file>
<file>assets/fonts/NotoSans-Thin.ttf</file>
<file>assets/fonts/NotoSansCJKkr-Regular.otf</file>
<file>assets/fonts/Roboto-Light.ttf</file>
<file>assets/fonts/Roboto-Regular.ttf</file>
<file>assets/fonts/Roboto-Thin.ttf</file>
<file>assets/fonts/RobotoMono-Light.ttf</file>
<file>assets/fonts/RobotoMono-Thin.ttf</file>
</qresource>
</RCC>