Skip to content

Commit f1eb91a

Browse files
authored
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.
1 parent 005ecca commit f1eb91a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ int main(int argc, char *argv[])
2323

2424
AOApplication::addLibraryPath(AOApplication::applicationDirPath() + "/lib");
2525

26+
QFontDatabase fontDatabase;
27+
QDirIterator it(main_app.get_base_path() + "fonts",
28+
QDirIterator::Subdirectories);
29+
while (it.hasNext())
30+
fontDatabase.addApplicationFont(it.next());
31+
2632
QSettings *configini = main_app.configini;
2733

2834
QPluginLoader apngPlugin("qapng");

0 commit comments

Comments
 (0)