From afa3f50b8a2bc47a243156c196f88ab799fe4f8f Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 23 Nov 2013 21:34:54 +0100 Subject: GRAPHICS: Let Font take uint32 as character codes. This is required to support UTF-32 strings but does not make them work automatically! --- graphics/font.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics/font.h') diff --git a/graphics/font.h b/graphics/font.h index 6819b42f52..62538e3e59 100644 --- a/graphics/font.h +++ b/graphics/font.h @@ -70,7 +70,7 @@ public: * @param chr The character to query the width of. * @return The character's width. */ - virtual int getCharWidth(byte chr) const = 0; + virtual int getCharWidth(uint32 chr) const = 0; /** * Query the kerning offset between two characters. @@ -79,7 +79,7 @@ public: * @param right The right character. May be 0. * @return The horizontal displacement. */ - virtual int getKerningOffset(byte left, byte right) const; + virtual int getKerningOffset(uint32 left, uint32 right) const; /** * Draw a character at a specific point on a surface. @@ -96,7 +96,7 @@ public: * @param y The y coordinate where to draw the character. * @param color The color of the character. */ - virtual void drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const = 0; + virtual void drawChar(Surface *dst, uint32 chr, int x, int y, uint32 color) const = 0; // TODO: Add doxygen comments to this void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const; -- cgit v1.2.3 From 9da09f584679553098c748f2839a617ed1774e83 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 23 Nov 2013 21:34:54 +0100 Subject: GRAPHICS: Allow Font to accept U32String as strings. --- graphics/font.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'graphics/font.h') diff --git a/graphics/font.h b/graphics/font.h index 62538e3e59..77b7623a85 100644 --- a/graphics/font.h +++ b/graphics/font.h @@ -23,6 +23,7 @@ #define GRAPHICS_FONT_H #include "common/str.h" +#include "common/ustr.h" namespace Common { template class Array; @@ -100,11 +101,13 @@ public: // TODO: Add doxygen comments to this void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const; + void drawString(Surface *dst, const Common::U32String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft) const; /** * Compute and return the width the string str has when rendered using this font. */ int getStringWidth(const Common::String &str) const; + int getStringWidth(const Common::U32String &str) const; /** * Take a text (which may contain newline characters) and word wrap it so that @@ -120,6 +123,7 @@ public: * @return the maximal width of any of the lines added to lines */ int wordWrapText(const Common::String &str, int maxWidth, Common::Array &lines) const; + int wordWrapText(const Common::U32String &str, int maxWidth, Common::Array &lines) const; }; } // End of namespace Graphics -- cgit v1.2.3 From 53332e806670cdff27dc0d2faa85cad066a5cdc9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:20 +0100 Subject: GRAPHICS: Make GPL headers consistent in themselves. --- graphics/font.h | 1 + 1 file changed, 1 insertion(+) (limited to 'graphics/font.h') diff --git a/graphics/font.h b/graphics/font.h index 77b7623a85..f333107780 100644 --- a/graphics/font.h +++ b/graphics/font.h @@ -17,6 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * */ #ifndef GRAPHICS_FONT_H -- cgit v1.2.3