Add special font configuration for flatpak
This commit is contained in:
@@ -20,6 +20,8 @@ include(KDEClangFormat)
|
|||||||
include(KDECMakeSettings)
|
include(KDECMakeSettings)
|
||||||
include(KDECompilerSettings NO_POLICY_SCOPE)
|
include(KDECompilerSettings NO_POLICY_SCOPE)
|
||||||
|
|
||||||
|
include(cmake/Flatpak.cmake)
|
||||||
|
|
||||||
# Fix a crash due to problems with quotient's event system. Can probably be removed once the reworked event system is in
|
# Fix a crash due to problems with quotient's event system. Can probably be removed once the reworked event system is in
|
||||||
cmake_policy(SET CMP0063 OLD)
|
cmake_policy(SET CMP0063 OLD)
|
||||||
|
|
||||||
|
|||||||
16
cmake/Flatpak.cmake
Normal file
16
cmake/Flatpak.cmake
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
if(NOT NEOCHAT_FLATPAK)
|
||||||
|
# Only include this if we build a Flatpak
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
# Include FontConfig config which uses the Emoji One font from the
|
||||||
|
# KDE Flatpak SDK.
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Flatpak/99-noto-mono-color-emoji.conf
|
||||||
|
DESTINATION
|
||||||
|
${CMAKE_INSTALL_SYSCONFDIR}/fonts/conf.d/
|
||||||
|
)
|
||||||
|
|
||||||
23
cmake/Flatpak/99-noto-mono-color-emoji.conf
Normal file
23
cmake/Flatpak/99-noto-mono-color-emoji.conf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||||
|
<fontconfig>
|
||||||
|
<alias>
|
||||||
|
<family>serif</family>
|
||||||
|
<prefer>
|
||||||
|
<family>Emoji One</family>
|
||||||
|
</prefer>
|
||||||
|
</alias>
|
||||||
|
<alias>
|
||||||
|
<family>sans-serif</family>
|
||||||
|
<prefer>
|
||||||
|
<family>Emoji One</family>
|
||||||
|
</prefer>
|
||||||
|
</alias>
|
||||||
|
<alias>
|
||||||
|
<family>monospace</family>
|
||||||
|
<prefer>
|
||||||
|
<family>Emoji One</family>
|
||||||
|
</prefer>
|
||||||
|
</alias>
|
||||||
|
</fontconfig>
|
||||||
|
|
||||||
@@ -28,6 +28,10 @@ target_include_directories(neochat PRIVATE ${CMAKE_BINARY_DIR})
|
|||||||
target_link_libraries(neochat PRIVATE Qt5::Quick Qt5::Qml Qt5::Gui Qt5::Network Qt5::QuickControls2 KF5::I18n KF5::Kirigami2 KF5::Notifications KF5::ConfigCore KF5::ConfigGui KF5::CoreAddons Quotient cmark::cmark)
|
target_link_libraries(neochat PRIVATE Qt5::Quick Qt5::Qml Qt5::Gui Qt5::Network Qt5::QuickControls2 KF5::I18n KF5::Kirigami2 KF5::Notifications KF5::ConfigCore KF5::ConfigGui KF5::CoreAddons Quotient cmark::cmark)
|
||||||
kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc)
|
kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc)
|
||||||
|
|
||||||
|
if(NEOCHAT_FLATPAK)
|
||||||
|
target_compile_definitions(neochat PRIVATE NEOCHAT_FLATPAK)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (KQuickImageEditor_FOUND)
|
if (KQuickImageEditor_FOUND)
|
||||||
target_compile_definitions(neochat PRIVATE HAS_KQUICKIMAGEEDITOR)
|
target_compile_definitions(neochat PRIVATE HAS_KQUICKIMAGEEDITOR)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -76,6 +76,13 @@ int main(int argc, char *argv[])
|
|||||||
KDBusService service(KDBusService::Unique);
|
KDBusService service(KDBusService::Unique);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef NEOCHAT_FLATPAK
|
||||||
|
// Copy over the included FontConfig configuration to the
|
||||||
|
// app's config dir:
|
||||||
|
QFile::copy("/app/etc/fonts/conf.d/99-noto-mono-color-emoji.conf",
|
||||||
|
"/var/config/fontconfig/conf.d/99-noto-mono-color-emoji.conf");
|
||||||
|
#endif
|
||||||
|
|
||||||
Clipboard clipboard;
|
Clipboard clipboard;
|
||||||
auto config = NeoChatConfig::self();
|
auto config = NeoChatConfig::self();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user