[Scummvm-cvs-logs] scummvm master -> 9997493e36ff4a391b485d3794f04e5e1c3cf53f

lordhoto lordhoto at gmail.com
Mon Mar 19 23:22:49 CET 2012


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9a13b34549 GRAPHICS: Fix TTF glyph drawing at negative Y positions.
92327c7991 GRAPHICS: Render TTF glyphs at the right locations.
9997493e36 Merge pull request #210 from fuzzie/ttf-fixes


Commit: 9a13b3454924390620675177785c8e1ef25b0f2b
    https://github.com/scummvm/scummvm/commit/9a13b3454924390620675177785c8e1ef25b0f2b
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2012-03-19T14:57:48-07:00

Commit Message:
GRAPHICS: Fix TTF glyph drawing at negative Y positions.

Changed paths:
    graphics/fonts/ttf.cpp



diff --git a/graphics/fonts/ttf.cpp b/graphics/fonts/ttf.cpp
index 0623179..5e3ed44 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;
 	}


Commit: 92327c799186e22e3e74cd332ae272556483420b
    https://github.com/scummvm/scummvm/commit/92327c799186e22e3e74cd332ae272556483420b
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2012-03-19T15:00:14-07:00

Commit Message:
GRAPHICS: Render TTF glyphs at the right locations.

Or at least using the fields used by the FreeType examples.

Changed paths:
    graphics/fonts/ttf.cpp



diff --git a/graphics/fonts/ttf.cpp b/graphics/fonts/ttf.cpp
index 5e3ed44..7505f79 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


Commit: 9997493e36ff4a391b485d3794f04e5e1c3cf53f
    https://github.com/scummvm/scummvm/commit/9997493e36ff4a391b485d3794f04e5e1c3cf53f
Author: Johannes Schickel (lordhoto at gmail.com)
Date: 2012-03-19T15:22:25-07:00

Commit Message:
Merge pull request #210 from fuzzie/ttf-fixes

TTF rendering fixes

Changed paths:
    graphics/fonts/ttf.cpp









More information about the Scummvm-git-logs mailing list