From c771a86f83a563a08d92de527530fe7a6afd7e0f Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Mon, 22 Feb 2021 13:00:47 -0600 Subject: [PATCH] Load fonts located in base/fonts This will register any font (OTF/TTF) located in the base/fonts folder recursively. They can be used for any purpose, without needing to install them on the system. --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index ce8b1ddea..ef61bca33 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,6 +23,12 @@ int main(int argc, char *argv[]) AOApplication::addLibraryPath(AOApplication::applicationDirPath() + "/lib"); + QFontDatabase fontDatabase; + QDirIterator it(main_app.get_base_path() + "fonts", + QDirIterator::Subdirectories); + while (it.hasNext()) + fontDatabase.addApplicationFont(it.next()); + QSettings *configini = main_app.configini; QPluginLoader apngPlugin("qapng");