-
Notifications
You must be signed in to change notification settings - Fork 2
/
Font.h
30 lines (23 loc) · 616 Bytes
/
Font.h
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
#pragma once
#include <cstdint> // std::int32_t, std::uint32_t
struct _TTF_Font;
using TTF_Font = _TTF_Font;
namespace ptgn {
namespace internal {
class Font {
public:
Font() = default;
/*
* @param font_path Path to font file.
* @param point_size Point size (based on 72 DPI). This translates to pixel height.
* @param index Font face index, the first face is 0.
*/
Font(const char* font_path, std::uint32_t point_size, std::uint32_t index = 0);
~Font();
std::int32_t GetHeight() const;
operator TTF_Font*() const;
private:
TTF_Font* font_{ nullptr };
};
} // namespace internal
} // namespace ptgn