diff options
author | Thanasis Antoniou | 2019-07-21 22:42:09 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2019-08-02 00:08:38 +0200 |
commit | 1bca3de594d5403ce0a71ffe2c3b5e1107bc816e (patch) | |
tree | 42fa2e28fcad1539f91c1aa3536cc7b7777df001 /graphics/font.h | |
parent | 72c50d38ae3aa748dfa15ee24971e80162797d1b (diff) | |
download | scummvm-rg350-1bca3de594d5403ce0a71ffe2c3b5e1107bc816e.tar.gz scummvm-rg350-1bca3de594d5403ce0a71ffe2c3b5e1107bc816e.tar.bz2 scummvm-rg350-1bca3de594d5403ce0a71ffe2c3b5e1107bc816e.zip |
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)
Diffstat (limited to 'graphics/font.h')
-rw-r--r-- | graphics/font.h | 4 |
1 files changed, 2 insertions, 2 deletions
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<Common::String> &lines, int initWidth = 0) const; - int wordWrapText(const Common::U32String &str, int maxWidth, Common::Array<Common::U32String> &lines, int initWidth = 0) const; + int wordWrapText(const Common::String &str, int maxWidth, Common::Array<Common::String> &lines, int initWidth = 0, bool evenWidthLinesModeEnabled = false, bool wrapOnExplicitNewLines = true) const; + int wordWrapText(const Common::U32String &str, int maxWidth, Common::Array<Common::U32String> &lines, int initWidth = 0, bool evenWidthLinesModeEnabled = false, bool wrapOnExplicitNewLines = true) const; private: Common::String handleEllipsis(const Common::String &str, int w) const; |