TGUI  0.9.3
BackendText.hpp
1
2//
3// TGUI - Texus' Graphical User Interface
4// Copyright (C) 2012-2021 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
26#ifndef TGUI_BACKEND_TEXT_HPP
27#define TGUI_BACKEND_TEXT_HPP
28
29#include <TGUI/Text.hpp>
30
32
33namespace tgui
34{
38 class TGUI_API BackendTextBase
39 {
40 public:
41
45 virtual ~BackendTextBase() = default;
46
47
52 virtual Vector2f getSize() = 0;
53
54
59 virtual void setString(const String& string) = 0;
60
61
66 virtual void setCharacterSize(unsigned int characterSize) = 0;
67
68
73 virtual void setFillColor(const Color& color) = 0;
74
75
80 virtual void setOutlineColor(const Color& color) = 0;
81
82
87 virtual void setOutlineThickness(float thickness) = 0;
88
89
94 virtual void setStyle(TextStyles style) = 0;
95
96
101 virtual void setFont(const Font& font) = 0;
102
103
108 virtual Vector2f findCharacterPos(std::size_t index) const = 0;
109 };
110}
111
113
114#endif // TGUI_BACKEND_TEXT_HPP
Base class for text implementations that depend on the backend.
Definition: BackendText.hpp:39
virtual void setString(const String &string)=0
Changes the text.
virtual void setFillColor(const Color &color)=0
Changes the color of the text.
virtual void setCharacterSize(unsigned int characterSize)=0
Sets the size of the characters.
virtual void setOutlineThickness(float thickness)=0
Changes the thickness of the text outline.
virtual void setOutlineColor(const Color &color)=0
Changes the color of the text outline.
virtual Vector2f getSize()=0
Returns the size of the text.
virtual Vector2f findCharacterPos(std::size_t index) const =0
Returns the top-left position of the character at the provided index.
virtual void setStyle(TextStyles style)=0
Changes the text style.
virtual ~BackendTextBase()=default
Virtual destructor.
virtual void setFont(const Font &font)=0
Changes the font used by the text.
Wrapper for colors.
Definition: Color.hpp:63
Definition: Font.hpp:56
Wrapper class to store strings.
Definition: String.hpp:79
Wrapper for text styles.
Definition: TextStyle.hpp:58
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:36