diff options
| author | Salanto <62221668+Salanto@users.noreply.github.com> | 2024-10-17 22:19:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-17 15:19:23 -0500 |
| commit | 7f17c0b69714bccaa649b4bd70afdf321176458e (patch) | |
| tree | fa49b74dec25ea2052db9d6b981836c0d8af2fc3 /src/main.cpp | |
| parent | 4c22bdc3367c75945155b548de9e2e6fc5375aeb (diff) | |
Add fonts from mounted folders (#1051)
* Add fonts from all mount paths
closes #980
* Optimise includes
* Woopsie
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index 41215f33..2743eeb2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,7 +2,7 @@ #include "aoapplication.h" #include "courtroom.h" -#include "datatypes.h" +#include "file_functions.h" #include "lobby.h" #include <QDebug> @@ -41,10 +41,17 @@ int main(int argc, char *argv[]) new_font.setPointSize(new_font_size); QApplication::setFont(new_font); - QDirIterator it(get_base_path() + "fonts", QDirIterator::Subdirectories); - while (it.hasNext()) + QStringList font_paths; + font_paths.append(get_base_path()); + font_paths.append(Options::getInstance().mountPaths()); + + for (const QString &path : font_paths) { - QFontDatabase::addApplicationFont(it.next()); + QDirIterator it(path + "fonts", QDirIterator::Subdirectories); + while (it.hasNext()) + { + QFontDatabase::addApplicationFont(it.next()); + } } QStringList expected_formats{"webp", "apng", "gif"}; |
