Move wordwrapping functions and len to Font.cpp/font:: namespace

The following functions were moved directly:
- next_wrap
- next_wrap_s
- string_wordwrap
- string_wordwrap_balanced
- string_unwordwrap

These ones will probably still need get a flags argument, except for
string_unwordwrap (since they need to know what font we're talking
about.

The implementation of graphics.len has also been moved to Font.cpp,
but graphics.len still exists for now and is deprecated.
This commit is contained in:
Dav999-v
2023-01-06 19:17:50 +01:00
committed by Misa Elizabeth Kai
parent 1d8494db8d
commit 159c70dade
9 changed files with 262 additions and 251 deletions

View File

@@ -672,7 +672,7 @@ void Game::crewmate_textbox(const int r, const int g, const int b)
/* This is a special case for wrapping, we MUST have two lines.
* So just make sure it can't fit in one line. */
const char* text = loc::gettext("You have rescued a crew member!");
std::string wrapped = graphics.string_wordwrap_balanced(text, graphics.len(text)-1);
std::string wrapped = font::string_wordwrap_balanced(text, graphics.len(text)-1);
size_t startline = 0;
size_t newline;