mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-25 20:22:39 +01:00
Move fonts into dedicated big qrc
This commit is contained in:
parent
2c8a0450bf
commit
103348c1ca
@ -76,13 +76,15 @@ set(l10n
|
|||||||
set_source_files_properties(${l10n} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/translations")
|
set_source_files_properties(${l10n} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/translations")
|
||||||
qt5_add_translation(qmFiles ${l10n})
|
qt5_add_translation(qmFiles ${l10n})
|
||||||
|
|
||||||
|
qt5_add_big_resources(fonts fonts.qrc)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
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()
|
else()
|
||||||
qtquick_compiler_add_resources(qml qml.qrc Resources.qrc)
|
qtquick_compiler_add_resources(qml qml.qrc assets.qrc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} ${src} ${headers} ${resources} ${qml})
|
add_executable(${PROJECT_NAME} ${src} ${headers} ${resources} ${qml} ${fonts})
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
#set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE true)
|
#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)
|
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()
|
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_compile_definitions(${PROJECT_NAME} PRIVATE "GIT_VERSION=${GIT_VERSION}")
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
|
@ -70,9 +70,7 @@ App::App()
|
|||||||
QFontDatabase::addApplicationFont(":/assets/fonts/NotoSans-Medium.ttf");
|
QFontDatabase::addApplicationFont(":/assets/fonts/NotoSans-Medium.ttf");
|
||||||
QFontDatabase::addApplicationFont(":/assets/fonts/NotoSans-Light.ttf");
|
QFontDatabase::addApplicationFont(":/assets/fonts/NotoSans-Light.ttf");
|
||||||
|
|
||||||
if (-1 == QFontDatabase::addApplicationFont(QGuiApplication::applicationDirPath() + "/assets/fonts/NotoSansCJKkr-Regular.otf")) {
|
QFontDatabase::addApplicationFont(":/assets/fonts/NotoSansCJKkr-Regular.otf");
|
||||||
qWarning() << "Could not load korean font from: " << QGuiApplication::applicationDirPath() + "/assets/fonts/NotoSansCJKkr-Regular.otf";
|
|
||||||
}
|
|
||||||
|
|
||||||
QQuickWindow::setTextRenderType(QQuickWindow::TextRenderType::NativeTextRendering);
|
QQuickWindow::setTextRenderType(QQuickWindow::TextRenderType::NativeTextRendering);
|
||||||
|
|
||||||
@ -224,14 +222,13 @@ bool App::loadSteamPlugin()
|
|||||||
isDebug = false;
|
isDebug = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef Q_OS_MACOS
|
#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);
|
m_workshopPlugin.setFileName(QApplication::applicationDirPath() + "/libScreenPlayWorkshop" + fileSuffix);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#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);
|
m_workshopPlugin.setFileName(QApplication::applicationDirPath() + "/ScreenPlayWorkshop" + fileSuffix);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -239,11 +236,9 @@ bool App::loadSteamPlugin()
|
|||||||
const QString fileSuffix = ".so";
|
const QString fileSuffix = ".so";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!m_workshopPlugin.load()) {
|
if (!m_workshopPlugin.load()) {
|
||||||
qWarning() << "Steam plugin not provided!" << QApplication::applicationDirPath() + "/ScreenPlayWorkshop" + fileSuffix;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,16 +1,6 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>assets/WorkshopPreview.html</file>
|
<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/app.ico</file>
|
||||||
<file>assets/icons/brand_github.svg</file>
|
<file>assets/icons/brand_github.svg</file>
|
||||||
<file>assets/icons/brand_gitlab.svg</file>
|
<file>assets/icons/brand_gitlab.svg</file>
|
15
ScreenPlay/fonts.qrc
Normal file
15
ScreenPlay/fonts.qrc
Normal 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>
|
Loading…
Reference in New Issue
Block a user