Skip to content

Commit

Permalink
Fix using custom font and about splash screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
bohning committed Sep 30, 2024
1 parent 7513beb commit bcac880
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <QColor>
#include <QDateTime>
#include <QFont>
#include <QFontDatabase>
#include <QTranslator>
#include <QSettings>
#include <QSplashScreen>
Expand Down Expand Up @@ -38,9 +39,11 @@ int main(int argc, char *argv[]) {
QPainter painter(&canvas);
painter.setPen(QColor(0, 174, 239)); // light blue

QFont font(":/splash/KozGoPro-ExtraLight.otf");
font.setPointSize(24);
painter.setFont(font);
int fontId = QFontDatabase::addApplicationFont(":/splash/KozGoPro-ExtraLight.otf");
QString fontFamily = QFontDatabase::applicationFontFamilies(fontId).at(0);
QFont versionFont(fontFamily);
versionFont.setPixelSize(24);
painter.setFont(versionFont);

painter.drawText(
0, 0, 418, 130,
Expand Down
Binary file modified src/resources/about_bgr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bcac880

Please sign in to comment.