From 93ca4b363b32ebd7a85cc705b5bb790c144e7066 Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Thu, 25 Feb 2021 19:02:35 +1100 Subject: DocumentStyle: fixes for font issues This commit should hopefully fix all the font problems we were having. Instead of using font substitution for emojis, we just instead call QFont::setFamilies. Builds with Qt versions below 5.13 will not have proper emoji support. 0) emojis seem to work fine at least in my environment 1) when selecting theme with font that is not on the system, a respectable default is used instead 2) custom fonts now work great on Windows (seems to be due to the removal of insertSubstitutions, which didn't seem to work in my build) 3) the dodgey 'Kristall XX' stuff was removed, as it seems like we don't need it --- src/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index f969834..546371c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -97,8 +97,15 @@ int main(int argc, char *argv[]) { // Initialise default fonts + #ifdef Q_OS_WIN32 + // Windows default fonts are ugly, so we use standard ones. + kristall::default_font_family = "Segoe UI"; + kristall::default_font_family_fixed = "Consolas"; + #else + // *nix kristall::default_font_family = QFontDatabase::systemFont(QFontDatabase::GeneralFont).family(); kristall::default_font_family_fixed = QFontInfo(QFont("monospace")).family(); + #endif kristall::document_style.initialiseDefaultFonts(); } -- cgit v1.2.3