Skip to content

Commit

Permalink
attempt to fix fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
p2r3 committed Aug 22, 2024
1 parent 8c1bbfa commit 738c00c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ build
ui/*.h
qt5
qt5-static
Quicksand.ttf
fonts
win
13 changes: 5 additions & 8 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(
"<p style='line-height: 0.8em; max-height: 1.6em;'>" + package->description + "</p>"
));
itemUI.PackageDescription->setText(QString::fromStdString(package->description));

// Connect the install button
QPushButton *installButton = itemUI.PackageInstallButton;
Expand Down
6 changes: 4 additions & 2 deletions resources.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<RCC>
<qresource prefix="/">
<file>Quicksand.ttf</file>
<qresource prefix="/fonts/">
<file>fonts/Quicksand-Light.ttf</file>
<file>fonts/Quicksand-Regular.ttf</file>
<file>fonts/Quicksand-Medium.ttf</file>
</qresource>
</RCC>

0 comments on commit 738c00c

Please sign in to comment.