-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfont.m.cpp
More file actions
38 lines (29 loc) · 900 Bytes
/
font.m.cpp
File metadata and controls
38 lines (29 loc) · 900 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
#include "fonts.hpp"
#include <iostream>
#include <vector>
#include <SDL.h>
int main(int argc, char *argv[]) {
(void)argc;
(void)argv;
auto font_manager = fonts::Manager();
auto families = font_manager.familyList();
for(auto& f: families) {
std::cout << f << std::endl;
}
const std::vector<fonts::Style> styles = {
fonts::Style::Regular, fonts::Style::RegularItalic, fonts::Style::Bold,
fonts::Style::BoldItalic};
for (auto family : families) {
for (auto style : styles) {
auto selected = font_manager.query(family, style, false);
std::cout << "Family: " << family << "_Style:" << style << " -> ";
if (selected) {
std::cout << selected.value() << std::endl;
} else {
std::cout << "NONE!" << std::endl;
}
}
}
auto selected = font_manager.query("Ubuntu Mono", fonts::Style::Regular, true);
return 0;
}