diff --git a/calendarwindow.cpp b/calendarwindow.cpp
index 7147f55..ac02e5a 100755
--- a/calendarwindow.cpp
+++ b/calendarwindow.cpp
@@ -20,9 +20,17 @@ CalendarWindow::CalendarWindow(QWidget *parent) :
blockSignals(false)
{
ui->setupUi(this);
+
+ // Apply the custom font
+ int fontId = QFontDatabase::addApplicationFont(":/resources/Laila-Medium.ttf");
+ if (fontId != -1) {
+ QString fontFamily = QFontDatabase::applicationFontFamilies(fontId).at(0);
+ QFont appFont(fontFamily);
+ qApp->setFont(appFont);
+ }
+
this->setWindowTitle("नेपाली पात्रो तथा मिति परिवर्तक");
connect(ui->aboutbutton, &QPushButton::clicked, this, &CalendarWindow::showMenu);
- // Center the window on the screen
centerOnScreen();
installEventFilter(this);
@@ -33,11 +41,6 @@ CalendarWindow::CalendarWindow(QWidget *parent) :
file.close();
}
- int fontId = QFontDatabase::addApplicationFont(":/resources/Laila-Medium.ttf");
- QString fontFamily = QFontDatabase::applicationFontFamilies(fontId).at(0);
- QFont appFont(fontFamily);
- CalendarWindow::setFont(appFont);
-
// Initialize current date to today's date
QDate currentDate = QDate::currentDate();
// Populate AD combo boxes
diff --git a/resources.qrc b/resources.qrc
index 8fddde0..4bbcedf 100755
--- a/resources.qrc
+++ b/resources.qrc
@@ -10,5 +10,6 @@
resources/VERSION.txt
resources/Laila-Medium.ttf
resources/flag.png
+ resources/Laila-Font-LICENSE
diff --git a/resources/Laila-Font-LICENSE b/resources/Laila-Font-LICENSE
new file mode 100644
index 0000000..57b4676
--- /dev/null
+++ b/resources/Laila-Font-LICENSE
@@ -0,0 +1,35 @@
+Laila
+Designed by Indian Type Foundry
+
+License
+Copyright (c) 2014, Indian Type Foundry (info@indiantypefoundry.com).
+This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is included below and is also available with a FAQ at: https://openfontlicense.org
+
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
+
+The OFL allows the licensed fonts to be used, studied, modified, and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed, and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+
+"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such.
+"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
+"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
+"Modified Version" refers to any derivative made by adding to, deleting, or substituting any of the components of the Original Version, by changing formats, or by porting the Font Software to a new environment.
+"Author" refers to any designer, engineer, programmer, technical writer, or other person who contributed to the Font Software.
+PERMISSION & CONDITIONS
+Permission is granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
+
+The Font Software, or any of its components, in Original or Modified Versions, may not be sold by itself.
+Copies of the Font Software may be bundled, redistributed, and/or sold with any software, provided that each copy includes the copyright notice and this license.
+No Modified Version of the Font Software may use the Reserved Font Name(s) without explicit permission.
+The names of the Copyright Holder(s) or Author(s) may not be used to promote or endorse any Modified Version without explicit permission.
+The Font Software, modified or unmodified, must remain under this license.
+TERMINATION
+This license becomes null and void if any of the above conditions are not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT.
+