diff options
author | Alyssa Milburn | 2012-03-19 23:00:12 +0100 |
---|---|---|
committer | Alyssa Milburn | 2012-03-19 23:00:14 +0100 |
commit | 92327c799186e22e3e74cd332ae272556483420b (patch) | |
tree | a8959b2d6e318488d8cf135c7dcf2ab8370c54f0 | |
parent | 9a13b3454924390620675177785c8e1ef25b0f2b (diff) | |
download | scummvm-rg350-92327c799186e22e3e74cd332ae272556483420b.tar.gz scummvm-rg350-92327c799186e22e3e74cd332ae272556483420b.tar.bz2 scummvm-rg350-92327c799186e22e3e74cd332ae272556483420b.zip |
GRAPHICS: Render TTF glyphs at the right locations.
Or at least using the fields used by the FreeType examples.
-rw-r--r-- | graphics/fonts/ttf.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/graphics/fonts/ttf.cpp b/graphics/fonts/ttf.cpp index 5e3ed44926..7505f7913e 100644 --- a/graphics/fonts/ttf.cpp +++ b/graphics/fonts/ttf.cpp @@ -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 |