Loading...
Searching...
No Matches
TextManipulators.h
Go to the documentation of this file.
1// Copyright (c) 2025 Dave R. Smith. All rights reserved.
2// Malena Framework — Proprietary Software. See LICENSE for terms.
3
4//
5// Created by Dave R. Smith on 3/12/25.
6//
7
8#ifndef MALENA_TEXTMANIPULATORS_H
9#define MALENA_TEXTMANIPULATORS_H
10
11#pragma once
12
14#include <string>
15#include <iostream>
16#include <sstream>
18
19namespace ml
20{
44 {
45 public:
59 static std::string wordwrap(const sf::Text& text, float maxwidth);
60
73 static std::string wordwrap(const std::string& input,
74 const sf::Font& font,
75 unsigned int characterSize,
76 float maxWidth);
77 };
78
79} // namespace ml
80
81#endif // MALENA_TEXTMANIPULATORS_H
Static helpers for text layout and string manipulation.
static std::string wordwrap(const std::string &input, const sf::Font &font, unsigned int characterSize, float maxWidth)
Wrap a string to fit within a pixel width, given explicit font settings.
static std::string wordwrap(const sf::Text &text, float maxwidth)
Wrap a string to fit within a pixel width, using an existing sf::Text.
#define MALENA_API
Definition Component.h:22