CSFML

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

Text.h
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
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 SFML_TEXT_H
26#define SFML_TEXT_H
27
29// Headers
31#include <SFML/Graphics/Export.h>
32#include <SFML/Graphics/Color.h>
33#include <SFML/Graphics/Rect.h>
34#include <SFML/Graphics/Types.h>
35#include <SFML/Graphics/Transform.h>
36#include <SFML/System/Vector2.h>
37#include <stddef.h>
38
39
43 typedef enum
44{
45 sfTextRegular = 0,
46 sfTextBold = 1 << 0,
47 sfTextItalic = 1 << 1,
48 sfTextUnderlined = 1 << 2,
49 sfTextStrikeThrough = 1 << 3
50} sfTextStyle;
51
52
59CSFML_GRAPHICS_API sfText* sfText_create(void);
60
69CSFML_GRAPHICS_API sfText* sfText_copy(const sfText* text);
70
77CSFML_GRAPHICS_API void sfText_destroy(sfText* text);
78
90CSFML_GRAPHICS_API void sfText_setPosition(sfText* text, sfVector2f position);
91
103CSFML_GRAPHICS_API void sfText_setRotation(sfText* text, float angle);
104
116CSFML_GRAPHICS_API void sfText_setScale(sfText* text, sfVector2f scale);
117
132CSFML_GRAPHICS_API void sfText_setOrigin(sfText* text, sfVector2f origin);
133
142CSFML_GRAPHICS_API sfVector2f sfText_getPosition(const sfText* text);
143
154CSFML_GRAPHICS_API float sfText_getRotation(const sfText* text);
155
164CSFML_GRAPHICS_API sfVector2f sfText_getScale(const sfText* text);
165
174CSFML_GRAPHICS_API sfVector2f sfText_getOrigin(const sfText* text);
175
186CSFML_GRAPHICS_API void sfText_move(sfText* text, sfVector2f offset);
187
198CSFML_GRAPHICS_API void sfText_rotate(sfText* text, float angle);
199
210CSFML_GRAPHICS_API void sfText_scale(sfText* text, sfVector2f factors);
211
220CSFML_GRAPHICS_API sfTransform sfText_getTransform(const sfText* text);
221
230CSFML_GRAPHICS_API sfTransform sfText_getInverseTransform(const sfText* text);
231
241CSFML_GRAPHICS_API void sfText_setString(sfText* text, const char* string);
242
250CSFML_GRAPHICS_API void sfText_setUnicodeString(sfText* text, const sfUint32* string);
251
266CSFML_GRAPHICS_API void sfText_setFont(sfText* text, const sfFont* font);
267
277CSFML_GRAPHICS_API void sfText_setCharacterSize(sfText* text, unsigned int size);
278
292CSFML_GRAPHICS_API void sfText_setLineSpacing(sfText* text, float spacingFactor);
293
312CSFML_GRAPHICS_API void sfText_setLetterSpacing(sfText* text, float spacingFactor);
313
325CSFML_GRAPHICS_API void sfText_setStyle(sfText* text, sfUint32 style);
326
341CSFML_GRAPHICS_API void sfText_setColor(sfText* text, sfColor color);
342
354CSFML_GRAPHICS_API void sfText_setFillColor(sfText* text, sfColor color);
355
365CSFML_GRAPHICS_API void sfText_setOutlineColor(sfText* text, sfColor color);
366
380CSFML_GRAPHICS_API void sfText_setOutlineThickness(sfText* text, float thickness);
381
390CSFML_GRAPHICS_API const char* sfText_getString(const sfText* text);
391
400CSFML_GRAPHICS_API const sfUint32* sfText_getUnicodeString(const sfText* text);
401
414CSFML_GRAPHICS_API const sfFont* sfText_getFont(const sfText* text);
415
424CSFML_GRAPHICS_API unsigned int sfText_getCharacterSize(const sfText* text);
425
436CSFML_GRAPHICS_API float sfText_getLetterSpacing(const sfText* text);
437
448CSFML_GRAPHICS_API float sfText_getLineSpacing(const sfText* text);
449
458CSFML_GRAPHICS_API sfUint32 sfText_getStyle(const sfText* text);
459
471CSFML_GRAPHICS_API sfColor sfText_getColor(const sfText* text);
472
481CSFML_GRAPHICS_API sfColor sfText_getFillColor(const sfText* text);
482
491CSFML_GRAPHICS_API sfColor sfText_getOutlineColor(const sfText* text);
492
501CSFML_GRAPHICS_API float sfText_getOutlineThickness(const sfText* text);
502
519CSFML_GRAPHICS_API sfVector2f sfText_findCharacterPos(const sfText* text, size_t index);
520
535CSFML_GRAPHICS_API sfFloatRect sfText_getLocalBounds(const sfText* text);
536
551CSFML_GRAPHICS_API sfFloatRect sfText_getGlobalBounds(const sfText* text);
552
553
554#endif // SFML_TEXT_H
sfColor
Utility class for manpulating RGBA colors.
Definition Color.h:39
sfFloatRect
sfFloatRect and sfIntRect are utility classes for manipulating rectangles.
Definition Rect.h:41
sfTransform
Encapsulate a 3x3 transform matrix.
Definition Transform.h:43
sfVector2f
2-component vector of floats
Definition Vector2.h:61