EHS
FontAtlas.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
ehs/EHS.h
"
4
#include "
ehs/Array.h
"
5
6
#include "
Glyph.h
"
7
#include "
ehs/Anchor.h
"
8
#include "
ehs/io/img/Img.h
"
9
#include "
ehs/io/mdl/Mesh.h
"
10
11
namespace
ehs
12
{
13
class
EHS_LIB_IO
FontAtlas
:
public
BaseObj
14
{
15
private
:
16
UInt_64 hashId;
17
Str_8
id;
18
UInt_64 glyphScale;
19
Array<Glyph>
glyphs;
20
Vec2_u64
resolution;
21
UInt_64 size;
22
Byte
* atlas;
23
24
public
:
25
~FontAtlas
()
override
;
26
27
FontAtlas
();
28
29
FontAtlas
(
const
Str_8
& filePath);
30
31
FontAtlas
(
FontAtlas
&& fa)
noexcept
;
32
33
FontAtlas
(
const
FontAtlas
& fa);
34
35
FontAtlas
& operator=(
FontAtlas
&& fa)
noexcept
;
36
37
FontAtlas
& operator=(
const
FontAtlas
& fa);
38
39
operator
Byte
*()
const
;
40
41
void
Release();
42
43
UInt_64 GetHashId()
const
;
44
45
Str_8
GetId()
const
;
46
47
UInt_64 GetGlyphScale()
const
;
48
49
const
Array<Glyph>
& GetGlyphs()
const
;
50
51
Glyph
GetGlyph(
Char_32
code)
const
;
52
53
Vec2_u64
GetResolution()
const
;
54
55
UInt_64 GetSize()
const
;
56
57
bool
IsValid()
const
;
58
59
Vec2_f
CalculateSize(
const
Str_8
& text)
const
;
60
61
float
CalculateWidth(
const
Str_8
& text)
const
;
62
63
float
CalculateHeight(
const
Str_8
& text)
const
;
64
65
UInt_64 CalculateIndexAtPoint(
const
Str_8
& text,
const
Vec2_f
& point)
const
;
66
67
Mesh
Generate(
Anchor
anchor,
const
Str_8
& text)
const
;
68
};
69
}
Anchor.h
Array.h
EHS.h
Glyph.h
Img.h
Mesh.h
ehs::Array
Definition:
Array.h:16
ehs::BaseObj
Definition:
BaseObj.h:9
ehs::FontAtlas
Definition:
FontAtlas.h:14
ehs::Glyph
Definition:
Glyph.h:11
ehs::Mesh
Definition:
Mesh.h:11
ehs::Str< Char_8, UInt_64 >
ehs::Vec2< UInt_64 >
ehs
Definition:
Anchor.h:6
ehs::Char_32
char32_t Char_32
Definition:
Types.h:42
ehs::Anchor
Anchor
Definition:
Anchor.h:8
ehs::Byte
unsigned char Byte
Definition:
Types.h:39
include
ehs
io
FontAtlas.h
Generated by
1.9.4