-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfonts.cpp
40 lines (38 loc) · 1.05 KB
/
fonts.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "fonts.h"
#include <QFile>
fonts::fonts()
{
// Load font file
{
const QString filename{"arial.ttf"};
QFile f(":/resources/fonts/" + filename);
f.copy(filename);
if (!m_arial_font.loadFromFile(filename.toStdString()))
{
QString msg{"Cannot find font file '" + filename + "'"};
throw std::runtime_error(msg.toStdString());
}
}
// Load font file
{
const QString filename{"CodeSquaredRegular-AYRg.ttf"};
QFile f(":/resources/fonts/" + filename);
f.copy(filename);
if (!m_code_squared_font.loadFromFile(filename.toStdString()))
{
QString msg{"Cannot find font file '" + filename + "'"};
throw std::runtime_error(msg.toStdString());
}
}
// Load font file
{
const QString filename{"16114_FuturistFixed-width.ttf"};
QFile f(":/resources/fonts/" + filename);
f.copy(filename);
if (!m_futuristic_font.loadFromFile(filename.toStdString()))
{
QString msg{"Cannot find font file '" + filename + "'"};
throw std::runtime_error(msg.toStdString());
}
}
}