-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfonts.hpp
38 lines (30 loc) · 920 Bytes
/
fonts.hpp
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
#pragma once
#include "util.hpp"
#include <cassert>
#include <iomanip>
#include <optional>
#include <vector>
#include <variant>
namespace fonts {
class FontDescription {
public:
std::string family;
std::string font_data;
friend std::ostream &operator<<(std::ostream &out,
const FontDescription &des) {
return (out << "Font(" << std::quoted(des.family)
<< ", size:" << des.font_data.size() << "(bytes))");
}
};
enum class Style { Regular, Bold, RegularItalic, BoldItalic };
std::ostream &operator<<(std::ostream &out, Style s);
class Manager {
public:
std::optional<FontDescription> defaultFont() {
return query({}, Style::Regular, true);
}
std::vector<std::string> familyList();
std::optional<FontDescription> query(std::optional<std::string> family,
Style, bool load_data);
};
} // namespace fonts