libart-paperback
0.1.0-a.1.20260122225059.e5fea306241a
PDF (1.4) library for C++
Main Page
Related Pages
Namespaces
Classes
Files
File List
font.hxx
1
#ifndef art__paperback__graphics__font_hxx_
2
#define art__paperback__graphics__font_hxx_
3
4
#include <art/paperback/types.hxx>
5
#include <art/paperback/forward.hxx>
6
7
namespace
Art::Paperback::Graphics
8
{
9
10
/// Represents text width computations.
11
///
12
struct
Text_width
13
{
14
/// Character count.
15
///
16
uint32_t
character_count
{};
17
18
/// Space count.
19
///
20
uint32_t
space_count
{};
21
22
/// Text width.
23
///
24
double
width
{};
25
26
};
27
28
/// Base class for fonts.
29
///
30
class
Font
31
{
32
public
:
33
/// Destructor.
34
///
35
virtual
36
~Font
() noexcept
37
{}
38
39
/// Access the parent document of this font.
40
///
41
virtual
42
Document
&
43
document
() = 0;
44
45
/// Get the COS object for this font.
46
///
47
virtual
48
Carousel::Object
49
object
() = 0;
50
51
/// Get the name of the font.
52
///
53
/// \return Returns the name of the font.
54
///
55
virtual
56
string
57
name
()
const
= 0;
58
59
/// Get the font ascent.
60
///
61
/// \return Returns the font ascent.
62
///
63
virtual
64
int16_t
65
get_ascent
()
const
= 0;
66
67
/// Get the font descent.
68
///
69
virtual
70
int16_t
71
get_descent
()
const
= 0;
72
73
/// Get the font X-height.
74
///
75
virtual
76
uint16_t
77
get_xheight
()
const
= 0;
78
79
/// Get the font cap-height.
80
///
81
virtual
82
uint16_t
83
get_capheight
()
const
= 0;
84
85
/// Compute text width.
86
///
87
virtual
88
Text_width
89
get_text_width
(
string
const
&) = 0;
90
91
protected
:
92
/// Constructor.
93
///
94
Font
()
95
{}
96
97
private
:
98
Font
(
Font
const
&) =
delete
;
99
Font
(
Font
&&) =
delete
;
100
Font
& operator=(
Font
const
&) =
delete
;
101
Font
& operator=(
Font
&&) =
delete
;
102
103
};
104
105
}
// namespace Art::Paperback::Graphics
106
107
#endif
Art::Paperback::Carousel::Object
Represents a COS-file object.
Definition
object.hxx:16
Art::Paperback::Document
Definition
document.hxx:12
Art::Paperback::Graphics::Font
Base class for fonts.
Definition
font.hxx:31
Art::Paperback::Graphics::Font::~Font
virtual ~Font() noexcept
Destructor.
Definition
font.hxx:36
Art::Paperback::Graphics::Font::get_descent
virtual int16_t get_descent() const =0
Get the font descent.
Art::Paperback::Graphics::Font::get_ascent
virtual int16_t get_ascent() const =0
Get the font ascent.
Art::Paperback::Graphics::Font::get_capheight
virtual uint16_t get_capheight() const =0
Get the font cap-height.
Art::Paperback::Graphics::Font::name
virtual string name() const =0
Get the name of the font.
Art::Paperback::Graphics::Font::get_text_width
virtual Text_width get_text_width(string const &)=0
Compute text width.
Art::Paperback::Graphics::Font::get_xheight
virtual uint16_t get_xheight() const =0
Get the font X-height.
Art::Paperback::Graphics::Font::document
virtual Document & document()=0
Access the parent document of this font.
Art::Paperback::Graphics::Font::object
virtual Carousel::Object object()=0
Get the COS object for this font.
Art::Paperback::Graphics::Font::Font
Font()
Constructor.
Definition
font.hxx:94
Art::Paperback::Graphics
Graphics namespace.
Definition
forward.hxx:105
Art::Paperback::Graphics::Text_width
Represents text width computations.
Definition
font.hxx:13
Art::Paperback::Graphics::Text_width::space_count
uint32_t space_count
Space count.
Definition
font.hxx:20
Art::Paperback::Graphics::Text_width::character_count
uint32_t character_count
Character count.
Definition
font.hxx:16
Art::Paperback::Graphics::Text_width::width
double width
Text width.
Definition
font.hxx:24
art
paperback
graphics
font.hxx
Generated by
1.13.2