aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2021-02-22 14:22:46 -0600
committerGitHub <noreply@github.com>2021-02-22 23:22:46 +0300
commitf1eb91a612ac1406d53b84ee5bad4fa83d78a09f (patch)
treef1cb6bd12b6dc29d93d8fc59849015863130a6ff /src/main.cpp
parent005ecca9d79e6a5973df487b6b4e094003e361a6 (diff)
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.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ce8b1dde..ef61bca3 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");