aboutsummaryrefslogtreecommitdiff
path: root/graphics/fonts/bdf.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2013-11-23 21:34:54 +0100
committerJohannes Schickel2013-11-23 21:34:54 +0100
commitafa3f50b8a2bc47a243156c196f88ab799fe4f8f (patch)
tree2da464a6122e0f15f3bf92297ccc28d48066fcf4 /graphics/fonts/bdf.cpp
parentb90400da44e4438c5a00773e6d2af82880dc45f4 (diff)
downloadscummvm-rg350-afa3f50b8a2bc47a243156c196f88ab799fe4f8f.tar.gz
scummvm-rg350-afa3f50b8a2bc47a243156c196f88ab799fe4f8f.tar.bz2
scummvm-rg350-afa3f50b8a2bc47a243156c196f88ab799fe4f8f.zip
GRAPHICS: Let Font take uint32 as character codes.
This is required to support UTF-32 strings but does not make them work automatically!
Diffstat (limited to 'graphics/fonts/bdf.cpp')
-rw-r--r--graphics/fonts/bdf.cpp8
1 files changed, 4 insertions, 4 deletions
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