From a0bbef1819db7eaae7b3fd7346bf039ac2e9e9be Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sun, 6 Apr 2014 17:19:42 +0200 Subject: [PATCH] Undo the kRenderJustXForceLeft bugfix of 4 commits back. The fix (adding adjustment of fRenderInfo.fDestPtr) made kRenderJustXForceLeft behave as intended (left-aligning the edge of the bitmap rather than the side bearing of the first character) but cuts off shadows in some places (e.g. at the left edges of "BUDDIES" and "NEIGHBORS" in the mini KI). To ensure enough space for the shadow, and considering that all content was developed and visually optimized with the bug in place, it seems better to preserve the buggy behavior and make kRenderJustXForceLeft work exactly like kRenderJustXLeft. --- .../Plasma/PubUtilLib/plGImage/plFont.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp index c40fc35f..c651409a 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp @@ -679,16 +679,14 @@ void plFont::IRenderString( plMipmap *mip, UInt16 x, UInt16 y, const wchar_t *st fRenderInfo.fRenderFunc = oldFunc; } - // Adjust for left kern - if( ( fRenderInfo.fFlags & kRenderJustXMask ) == kRenderJustXForceLeft ) - { - // See note at top of file - plCharacter &ch = fCharacters[ (UInt16)string[ 0 ] - fFirstChar ]; - fRenderInfo.fX -= (Int16)ch.fLeftKern; - fRenderInfo.fMaxWidth += (Int16)ch.fLeftKern; - fRenderInfo.fDestPtr -= (Int16)ch.fLeftKern * fRenderInfo.fDestBPP; - fRenderInfo.fFarthestX = fRenderInfo.fX; - } + // There used to be an adjustment of the X coordinate by -ch.fLeftKern for the case + // of kRenderJustXForceLeft here, but it was buggy in that it neglected to adjust + // fRenderInfo.fDestPtr and therefore had no visible effect (or almost none - only + // at the end of the line). Fixing the bug however (making kRenderJustXForceLeft + // work as intended) causes the text shadow to be cut off in some places. To ensure + // enough space for the shadow, and considering that all content was developed and + // visually optimized with the bug in place, it seems better to preserve the buggy + // behavior and make kRenderJustXForceLeft work exactly like kRenderJustXLeft. fRenderInfo.fVolatileStringPtr = string; // Just so we can keep track of when we clip IRenderLoop( string, -1 );