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/fonts/bdf.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'graphics/fonts/bdf.cpp') diff --git a/graphics/fonts/bdf.cpp b/graphics/fonts/bdf.cpp index e523a36ad5..7b2290cc3a 100644 --- a/graphics/fonts/bdf.cpp +++ b/graphics/fonts/bdf.cpp @@ -51,7 +51,7 @@ int BdfFont::getMaxCharWidth() const { return _data.maxAdvance; } -int BdfFont::getCharWidth(byte chr) const { +int BdfFont::getCharWidth(uint32 chr) const { // In case all font have the same advance value, we use the maximum. if (!_data.advances) return _data.maxAdvance; @@ -85,9 +85,9 @@ void drawCharIntern(byte *ptr, uint pitch, const byte *src, int h, int width, in } } -int BdfFont::mapToIndex(byte ch) const { +int BdfFont::mapToIndex(uint32 ch) const { // Check whether the character is included - if (_data.firstCharacter <= ch && ch <= _data.firstCharacter + _data.numCharacters) { + if (_data.firstCharacter <= (int)ch && (int)ch <= _data.firstCharacter + _data.numCharacters) { if (_data.bitmaps[ch - _data.firstCharacter]) return ch - _data.firstCharacter; } @@ -95,7 +95,7 @@ int BdfFont::mapToIndex(byte ch) const { return _data.defaultCharacter - _data.firstCharacter; } -void BdfFont::drawChar(Surface *dst, byte chr, const int tx, const int ty, const uint32 color) const { +void BdfFont::drawChar(Surface *dst, uint32 chr, const int tx, const int ty, const uint32 color) const { assert(dst != 0); // TODO: Where is the relation between the max advance being smaller or -- cgit v1.2.3