Loading...
Searching...
No Matches
TextManipulators.h
Go to the documentation of this file.
1//
2// Created by Dave R. Smith on 3/12/25.
3//
4
5#ifndef TEXTMANIPULATORS_H
6#define TEXTMANIPULATORS_H
7
8#pragma once
9
10#include <string>
11#include <iostream>
12#include <sstream>
14
15namespace ml
16{
40 {
41 public:
55 static std::string wordwrap(const sf::Text& text, float maxwidth);
56
69 static std::string wordwrap(const std::string& input,
70 const sf::Font& font,
71 unsigned int characterSize,
72 float maxWidth);
73 };
74
75} // namespace ml
76
77#endif // 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.
Definition Component.h:18