Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(UI): actually load bundled Unicode font as soon as possible
Browse files Browse the repository at this point in the history
Hopefully this fixes an issue with ugly fonts that started happening
some time ago for Windows & FreeBSD users.
  • Loading branch information
zetok committed Mar 12, 2017
1 parent d1ec8cc commit bfd4773
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ int main(int argc, char* argv[])
a.setOrganizationName("Tox");
a.setApplicationVersion("\nGit commit: " + QString(GIT_VERSION));

// Install Unicode 6.1 supporting font
// Keep this as close to the beginning of `main()` as possible, otherwise
// on systems that have poor support for Unicode qTox will look bad.
if (QFontDatabase::addApplicationFont("://font/DejaVuSans.ttf") == -1) {
qWarning() << "Couldn't load font";
}


#if defined(Q_OS_OSX)
// TODO: Add setting to enable this feature.
// osx::moveToAppFolder();
Expand Down Expand Up @@ -207,10 +215,6 @@ int main(int argc, char* argv[])
qDebug() << "built on: " << __TIME__ << __DATE__ << "(" << TIMESTAMP << ")";
qDebug() << "commit: " << GIT_VERSION << "\n";

// Install Unicode 6.1 supporting font
if (QFontDatabase::addApplicationFont("://font/DejaVuSans.ttf") == -1) {
qWarning() << "Couldn't load font";
}

// Check whether we have an update waiting to be installed
#if AUTOUPDATE_ENABLED
Expand Down

0 comments on commit bfd4773

Please sign in to comment.