Browse code

Add loading the default font for the XiPC emulator

Pawel Jablonski authored on 28/03/2023 21:28:04
Showing 1 changed files
... ...
@@ -10,6 +10,7 @@
10 10
  */
11 11
 
12 12
 #include <QApplication>
13
+#include <QFontDatabase>
13 14
 
14 15
 #include "emu.h"
15 16
 
... ...
@@ -23,6 +24,8 @@ int main(int argc, char *argv[])
23 24
 {
24 25
 	QApplication a(argc, argv);
25 26
 
27
+	QFontDatabase::addApplicationFont("fonts/DejaVuSansMono-Bold.ttf");
28
+
26 29
 	QFont font = a.font();
27 30
 
28 31
 	font.setFamily("DejaVu Sans Mono");
Browse code

Add source code of the XiPC emulator

Pawel Jablonski authored on 17/03/2023 16:46:08
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,38 @@
1
+/*
2
+ * Author: Pawel Jablonski
3
+ * E-mail: pj@xirx.net
4
+ * WWW: xirx.net
5
+ * GIT: git.xirx.net
6
+ *
7
+ * License: You can use this code however you like
8
+ * but leave information about the original author.
9
+ * Code is free for non-commercial and commercial use.
10
+ */
11
+
12
+#include <QApplication>
13
+
14
+#include "emu.h"
15
+
16
+/**
17
+ * Main entry function of the application
18
+ *
19
+ * @param argc Arguments count
20
+ * @param argv Arguments list stored in an array
21
+ */
22
+int main(int argc, char *argv[])
23
+{
24
+	QApplication a(argc, argv);
25
+
26
+	QFont font = a.font();
27
+
28
+	font.setFamily("DejaVu Sans Mono");
29
+	font.setPixelSize(11);
30
+	font.setBold(true);
31
+
32
+	a.setFont(font, "QWidget");
33
+
34
+	Emu emu;
35
+	emu.show();
36
+
37
+	return(a.exec());
38
+}