diff --git a/ScreenPlay/CMakeLists.txt b/ScreenPlay/CMakeLists.txt index f717f648..691c6edb 100644 --- a/ScreenPlay/CMakeLists.txt +++ b/ScreenPlay/CMakeLists.txt @@ -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( diff --git a/ScreenPlay/app.cpp b/ScreenPlay/app.cpp index 314731c7..01c8de1e 100644 --- a/ScreenPlay/app.cpp +++ b/ScreenPlay/app.cpp @@ -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; } diff --git a/ScreenPlay/Resources.qrc b/ScreenPlay/assets.qrc similarity index 92% rename from ScreenPlay/Resources.qrc rename to ScreenPlay/assets.qrc index fb87c206..0165efc9 100644 --- a/ScreenPlay/Resources.qrc +++ b/ScreenPlay/assets.qrc @@ -1,16 +1,6 @@ assets/WorkshopPreview.html - assets/fonts/LibreBaskerville-Italic.ttf - assets/fonts/NotoSans-Light.ttf - assets/fonts/NotoSans-Medium.ttf - assets/fonts/NotoSans-Regular.ttf - assets/fonts/NotoSans-Thin.ttf - assets/fonts/Roboto-Light.ttf - assets/fonts/Roboto-Regular.ttf - assets/fonts/Roboto-Thin.ttf - assets/fonts/RobotoMono-Light.ttf - assets/fonts/RobotoMono-Thin.ttf assets/icons/app.ico assets/icons/brand_github.svg assets/icons/brand_gitlab.svg diff --git a/ScreenPlay/fonts.qrc b/ScreenPlay/fonts.qrc new file mode 100644 index 00000000..76558247 --- /dev/null +++ b/ScreenPlay/fonts.qrc @@ -0,0 +1,15 @@ + + + assets/fonts/LibreBaskerville-Italic.ttf + assets/fonts/NotoSans-Light.ttf + assets/fonts/NotoSans-Medium.ttf + assets/fonts/NotoSans-Regular.ttf + assets/fonts/NotoSans-Thin.ttf + assets/fonts/NotoSansCJKkr-Regular.otf + assets/fonts/Roboto-Light.ttf + assets/fonts/Roboto-Regular.ttf + assets/fonts/Roboto-Thin.ttf + assets/fonts/RobotoMono-Light.ttf + assets/fonts/RobotoMono-Thin.ttf + +