[Scummvm-cvs-logs] scummvm master -> 66c3279b2f69a483ec3cc5ff1d8ed84e33621162

lordhoto lordhoto at gmail.com
Thu Feb 2 02:40:21 CET 2012


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

Summary:
6402d30874 GRAPHICS: Use monochrome font hinter for TTF's monochrome loading.
66c3279b2f GRAPHICS: Obtain pointer to dst surface after bounds checks in TTF renderer.


Commit: 6402d308747cc3d5969ca760101ebf6f34546bd2
    https://github.com/scummvm/scummvm/commit/6402d308747cc3d5969ca760101ebf6f34546bd2
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-02-01T17:39:40-08:00

Commit Message:
GRAPHICS: Use monochrome font hinter for TTF's monochrome loading.

Changed paths:
    graphics/fonts/ttf.cpp



diff --git a/graphics/fonts/ttf.cpp b/graphics/fonts/ttf.cpp
index 2ba6205..faf59a9 100644
--- a/graphics/fonts/ttf.cpp
+++ b/graphics/fonts/ttf.cpp
@@ -383,7 +383,7 @@ bool TTFFont::cacheGlyph(Glyph &glyph, FT_UInt &slot, uint chr) {
 	// We use the light target and render mode to improve the looks of the
 	// glyphs. It is most noticable in FreeSansBold.ttf, where otherwise the
 	// 't' glyph looks like it is cut off on the right side.
-	if (FT_Load_Glyph(_face, slot, (_monochrome ? FT_LOAD_MONOCHROME : FT_LOAD_TARGET_LIGHT)))
+	if (FT_Load_Glyph(_face, slot, (_monochrome ? FT_LOAD_TARGET_MONO : FT_LOAD_TARGET_LIGHT)))
 		return false;
 
 	if (FT_Render_Glyph(_face->glyph, (_monochrome ? FT_RENDER_MODE_MONO : FT_RENDER_MODE_LIGHT)))


Commit: 66c3279b2f69a483ec3cc5ff1d8ed84e33621162
    https://github.com/scummvm/scummvm/commit/66c3279b2f69a483ec3cc5ff1d8ed84e33621162
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-02-01T17:39:41-08:00

Commit Message:
GRAPHICS: Obtain pointer to dst surface after bounds checks in TTF renderer.

This should really make sure we are not drawing outside the surface bounds.

Changed paths:
    graphics/fonts/ttf.cpp



diff --git a/graphics/fonts/ttf.cpp b/graphics/fonts/ttf.cpp
index faf59a9..0623179 100644
--- a/graphics/fonts/ttf.cpp
+++ b/graphics/fonts/ttf.cpp
@@ -323,7 +323,6 @@ void TTFFont::drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const
 	int h = glyph.image.h;
 
 	const uint8 *srcPos = (const uint8 *)glyph.image.getBasePtr(0, 0);
-	uint8 *dstPos = (uint8 *)dst->getBasePtr(x, y);
 
 	// Make sure we are not drawing outside the screen bounds
 	if (x < 0) {
@@ -350,6 +349,8 @@ void TTFFont::drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const
 	if (h <= 0)
 		return;
 
+	uint8 *dstPos = (uint8 *)dst->getBasePtr(x, y);
+
 	if (dst->format.bytesPerPixel == 1) {
 		for (int cy = 0; cy < h; ++cy) {
 			uint8 *rDst = dstPos;






More information about the Scummvm-git-logs mailing list