From 1bca3de594d5403ce0a71ffe2c3b5e1107bc816e Mon Sep 17 00:00:00 2001 From: Thanasis Antoniou Date: Sun, 21 Jul 2019 22:42:09 +0300 Subject: COMMON: Support text wrapping with even width line segments The new arguments are optional. The lines segments will be close to the same width. The algorithm is similar to the one we had for Blade Runner but not exactly the same, since that one would wrap a line at a white space after the theoretical split point (quotient of full line text width divided by target lines number) --- graphics/font.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'graphics/font.h') diff --git a/graphics/font.h b/graphics/font.h index 48330dedfa..2fd5103a99 100644 --- a/graphics/font.h +++ b/graphics/font.h @@ -175,8 +175,8 @@ public: * @param initWidth the starting width of the first line, for partially filled lines (optional) * @return the maximal width of any of the lines added to lines */ - int wordWrapText(const Common::String &str, int maxWidth, Common::Array &lines, int initWidth = 0) const; - int wordWrapText(const Common::U32String &str, int maxWidth, Common::Array &lines, int initWidth = 0) const; + int wordWrapText(const Common::String &str, int maxWidth, Common::Array &lines, int initWidth = 0, bool evenWidthLinesModeEnabled = false, bool wrapOnExplicitNewLines = true) const; + int wordWrapText(const Common::U32String &str, int maxWidth, Common::Array &lines, int initWidth = 0, bool evenWidthLinesModeEnabled = false, bool wrapOnExplicitNewLines = true) const; private: Common::String handleEllipsis(const Common::String &str, int w) const; -- cgit v1.2.3