From 738c00cadd7730f72cd97ac30a4fdc8301df0b6a Mon Sep 17 00:00:00 2001 From: p2r3 Date: Thu, 22 Aug 2024 06:14:03 +0300 Subject: [PATCH] attempt to fix fonts --- .gitignore | 2 +- main.cpp | 13 +++++-------- resources.qrc | 6 ++++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index b4209cd..a1b31ab 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,5 @@ build ui/*.h qt5 qt5-static -Quicksand.ttf +fonts win diff --git a/main.cpp b/main.cpp index 7c7fe56..e3cc56c 100644 --- a/main.cpp +++ b/main.cpp @@ -46,11 +46,10 @@ int main (int argc, char *argv[]) { QApplication app(argc, argv); - // Load the Quicksand font from resources - int fontID = QFontDatabase::addApplicationFont(":/Quicksand.ttf"); - if (fontID == -1) { - std::cerr << "Failed to load font" << std::endl; - } + // Load the Quicksand fonts from resources + QFontDatabase::addApplicationFont(":/fonts/Quicksand-Light.ttf"); + QFontDatabase::addApplicationFont(":/fonts/Quicksand-Regular.ttf"); + QFontDatabase::addApplicationFont(":/fonts/Quicksand-Medium.ttf"); // Set up the main application window QMainWindow window; @@ -80,9 +79,7 @@ int main (int argc, char *argv[]) { // Set the title and description itemUI.PackageTitle->setText(QString::fromStdString(package->title)); - itemUI.PackageDescription->setText(QString::fromStdString( - "

" + package->description + "

" - )); + itemUI.PackageDescription->setText(QString::fromStdString(package->description)); // Connect the install button QPushButton *installButton = itemUI.PackageInstallButton; diff --git a/resources.qrc b/resources.qrc index 77b3de6..02bdeba 100644 --- a/resources.qrc +++ b/resources.qrc @@ -1,5 +1,7 @@ - - Quicksand.ttf + + fonts/Quicksand-Light.ttf + fonts/Quicksand-Regular.ttf + fonts/Quicksand-Medium.ttf