aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2012-03-19 15:22:25 -0700
committerJohannes Schickel2012-03-19 15:22:25 -0700
commit9997493e36ff4a391b485d3794f04e5e1c3cf53f (patch)
treea8959b2d6e318488d8cf135c7dcf2ab8370c54f0
parentbe8c557645bf73e96a463c60bd0422b39a3edfef (diff)
parent92327c799186e22e3e74cd332ae272556483420b (diff)
downloadscummvm-rg350-9997493e36ff4a391b485d3794f04e5e1c3cf53f.tar.gz
scummvm-rg350-9997493e36ff4a391b485d3794f04e5e1c3cf53f.tar.bz2
scummvm-rg350-9997493e36ff4a391b485d3794f04e5e1c3cf53f.zip
Merge pull request #210 from fuzzie/ttf-fixes
TTF rendering fixes
-rw-r--r--graphics/fonts/ttf.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/graphics/fonts/ttf.cpp b/graphics/fonts/ttf.cpp
index 06231799ce..7505f7913e 100644
--- a/graphics/fonts/ttf.cpp
+++ b/graphics/fonts/ttf.cpp
@@ -338,7 +338,7 @@ void TTFFont::drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const
return;
if (y < 0) {
- srcPos += y * glyph.image.pitch;
+ srcPos -= y * glyph.image.pitch;
h += y;
y = 0;
}
@@ -395,11 +395,11 @@ bool TTFFont::cacheGlyph(Glyph &glyph, FT_UInt &slot, uint chr) {
FT_Glyph_Metrics &metrics = _face->glyph->metrics;
- glyph.xOffset = ftFloor26_6(metrics.horiBearingX);
+ glyph.xOffset = _face->glyph->bitmap_left;
int xMax = glyph.xOffset + ftCeil26_6(metrics.width);
- glyph.yOffset = _ascent - ftFloor26_6(metrics.horiBearingY);
+ glyph.yOffset = _ascent - _face->glyph->bitmap_top;
- glyph.advance = ftCeil26_6(metrics.horiAdvance);
+ glyph.advance = ftCeil26_6(_face->glyph->advance.x);
// In case we got a negative xMin we adjust that, this might make some
// characters make a bit odd, but it's the only way we can assure no