-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.m.cpp
More file actions
41 lines (30 loc) · 989 Bytes
/
main.m.cpp
File metadata and controls
41 lines (30 loc) · 989 Bytes
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
41
#include "app.hpp"
#include "fonts.hpp"
#include "graphics.hpp"
#include <iostream>
int main(int argc, char *argv[]) {
(void)argc;
(void)argv;
gfx::context ctx;
if (!ctx) {
std::cerr << "Graphics init failed\n";
}
std::string family = "Ubuntu Mono";
gfx::FontSpec spec;
fonts::Manager font_manager;
auto regular = font_manager.query(family, fonts::Style::Regular, true);
auto bold = font_manager.query(family, fonts::Style::Bold, true);
auto bolditalic = font_manager.query(family, fonts::Style::BoldItalic, true);
auto italic = font_manager.query(family, fonts::Style::RegularItalic, true);
if (!regular || !bold || !bolditalic || !italic) {
std::cerr << "Unable to load all fonts" << std::endl;
return 1;
}
spec.regular = regular.value().font_data;
spec.bold = bold.value().font_data;
spec.bolditalic = bolditalic.value().font_data;
spec.italic = italic.value().font_data;
spec.pointsize = 16;
app::run(spec);
return 0;
}