Add fonts from mounted folders (#1051)
* Add fonts from all mount paths closes #980 * Optimise includes * Woopsie
This commit is contained in:
parent
4c22bdc336
commit
7f17c0b697
11
src/main.cpp
11
src/main.cpp
@ -2,7 +2,7 @@
|
|||||||
#include "aoapplication.h"
|
#include "aoapplication.h"
|
||||||
|
|
||||||
#include "courtroom.h"
|
#include "courtroom.h"
|
||||||
#include "datatypes.h"
|
#include "file_functions.h"
|
||||||
#include "lobby.h"
|
#include "lobby.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@ -41,11 +41,18 @@ int main(int argc, char *argv[])
|
|||||||
new_font.setPointSize(new_font_size);
|
new_font.setPointSize(new_font_size);
|
||||||
QApplication::setFont(new_font);
|
QApplication::setFont(new_font);
|
||||||
|
|
||||||
QDirIterator it(get_base_path() + "fonts", QDirIterator::Subdirectories);
|
QStringList font_paths;
|
||||||
|
font_paths.append(get_base_path());
|
||||||
|
font_paths.append(Options::getInstance().mountPaths());
|
||||||
|
|
||||||
|
for (const QString &path : font_paths)
|
||||||
|
{
|
||||||
|
QDirIterator it(path + "fonts", QDirIterator::Subdirectories);
|
||||||
while (it.hasNext())
|
while (it.hasNext())
|
||||||
{
|
{
|
||||||
QFontDatabase::addApplicationFont(it.next());
|
QFontDatabase::addApplicationFont(it.next());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QStringList expected_formats{"webp", "apng", "gif"};
|
QStringList expected_formats{"webp", "apng", "gif"};
|
||||||
for (const QByteArray &i_format : QImageReader::supportedImageFormats())
|
for (const QByteArray &i_format : QImageReader::supportedImageFormats())
|
||||||
|
Loading…
Reference in New Issue
Block a user