From f1eb91a612ac1406d53b84ee5bad4fa83d78a09f Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Mon, 22 Feb 2021 14:22:46 -0600 Subject: [PATCH] Load fonts located in base/fonts (#475) 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 ce8b1dd..ef61bca 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");