Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_graphics
Text
TextLayout.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
FontMesh.hpp
"
4
5
#include "../Elements/Elem.hpp"
6
#include "../Elements/ElementRenderer.hpp"
7
#include "../Elements/Slot.hpp"
8
9
namespace
iv
10
{
11
14
class
TextSegment
15
{
16
public
:
17
ClientMarker
cm
;
18
TextSegment
(
Elem
*
elem
);
19
Instance
*
instance
()
const
;
20
21
Elem
*
elem
();
22
Elem
const
*
elem
()
const
;
23
24
25
// synthesized parameters
31
bool
geometry_dirty
;
32
35
virtual
FontMesh::Geometry
geometry_Compute
(
FontMesh::Location
const
& ) = 0;
36
37
// inherited parameters
40
DirtyAttr< FontMesh::Location >
location
;
41
42
private
:
43
Elem
* _elem;
44
};
45
52
class
TextLayout
:
public
VectorChildrenElem
< TextSegment >,
public
SlotChild
53
{
54
public
:
55
ClientMarker
cm
;
56
using
Elem::instance
;
57
TextLayout
(
Instance
* );
58
59
// initialization parameters
60
DirtyAttr< float >
attr_lineSpacing
;
61
62
// utility methods
63
TextLayout
*
line_spacing
(
float
);
64
65
protected
:
66
virtual
void
first_pass_impl
(
ElementRenderer
* )
override
;
67
virtual
void
second_pass_impl
(
ElementRenderer
* )
override
;
68
69
private
:
70
void
RepositionChildren();
71
72
private
:
73
Heap
heap;
74
bool
geometry_dirty;
75
};
76
77
}