TGUI
=
=
Download
Tutorials
1.x
0.9
0.8
Documentation
1.x
0.9
0.8
Examples
1.x
0.9
0.8
Community
TGUI
1.x-dev
Toggle main menu visibility
Loading...
Searching...
No Matches
include
TGUI
TextStyle.hpp
1
2
//
3
// TGUI - Texus' Graphical User Interface
4
// Copyright (C) 2012-2026 Bruno Van de Velde (vdv_b@tgui.eu)
5
//
6
// This software is provided 'as-is', without any express or implied warranty.
7
// In no event will the authors be held liable for any damages arising from the use of this software.
8
//
9
// Permission is granted to anyone to use this software for any purpose,
10
// including commercial applications, and to alter it and redistribute it freely,
11
// subject to the following restrictions:
12
//
13
// 1. The origin of this software must not be misrepresented;
14
// you must not claim that you wrote the original software.
15
// If you use this software in a product, an acknowledgment
16
// in the product documentation would be appreciated but is not required.
17
//
18
// 2. Altered source versions must be plainly marked as such,
19
// and must not be misrepresented as being the original software.
20
//
21
// 3. This notice may not be removed or altered from any source distribution.
22
//
24
25
#ifndef TGUI_TEXT_STYLE_HPP
26
#define TGUI_TEXT_STYLE_HPP
27
28
#include <TGUI/String.hpp>
29
31
32
namespace
tgui
33
{
37
enum
TextStyle
:
unsigned
int
38
{
39
Regular
= 0,
40
Bold
= 1 << 0,
41
Italic
= 1 << 1,
42
Underlined
= 1 << 2,
43
StrikeThrough
= 1 << 3
44
};
45
54
class
TGUI_API
TextStyles
55
{
56
public
:
62
constexpr
TextStyles
() :
63
m_isSet{false},
64
m_style{
Regular
}
65
{
66
}
67
77
constexpr
TextStyles
(
unsigned
int
style) :
78
m_isSet{true},
79
m_style{style}
80
{
81
}
82
88
TextStyles
(
const
String
&
string
);
89
99
TextStyles
(
const
char
*
string
);
100
106
[[nodiscard]]
constexpr
bool
isSet
()
const
107
{
108
return
m_isSet;
109
}
110
116
constexpr
operator
unsigned
int()
const
117
{
118
return
m_style;
119
}
120
121
private
:
122
bool
m_isSet;
// Stores the flag indicating whether this object has been explicitly initialized or created from default.
123
124
unsigned
int
m_style;
// Stores the text styles represented by this object.
125
};
126
}
// namespace tgui
127
128
#endif
// TGUI_TEXT_STYLE_HPP
tgui::String
Wrapper class to store strings.
Definition
String.hpp:94
tgui::TextStyles::isSet
constexpr bool isSet() const
Checks if a style was set.
Definition
TextStyle.hpp:106
tgui::TextStyles::TextStyles
TextStyles(const char *string)
Creates the object from a string representing the text styles.
tgui::TextStyles::TextStyles
constexpr TextStyles(unsigned int style)
Creates the object from one or more tgui::TextStyle::Style enum members.
Definition
TextStyle.hpp:77
tgui::TextStyles::TextStyles
TextStyles(const String &string)
Creates the object from a string representing the text styles.
tgui::TextStyles::TextStyles
constexpr TextStyles()
Creates the object without a text style.
Definition
TextStyle.hpp:62
tgui
Namespace that contains all TGUI functions and classes.
Definition
AbsoluteOrRelativeValue.hpp:37
tgui::TextStyle
TextStyle
Enumeration of the text drawing styles.
Definition
TextStyle.hpp:38
tgui::Underlined
@ Underlined
Underlined characters.
Definition
TextStyle.hpp:42
tgui::Bold
@ Bold
Bold characters.
Definition
TextStyle.hpp:40
tgui::Italic
@ Italic
Italic characters.
Definition
TextStyle.hpp:41
tgui::Regular
@ Regular
Regular characters, no style.
Definition
TextStyle.hpp:39
tgui::StrikeThrough
@ StrikeThrough
Strike through characters.
Definition
TextStyle.hpp:43
Generated on
for TGUI by
1.18.0