Label:Fixed characters are displayed incorrectly with some specific font.

This commit is contained in:
Wenhai Lin 2016-02-02 11:16:36 +08:00
parent 30a7141ea0
commit bae36b7a98
1 changed files with 4 additions and 2 deletions

View File

@ -321,6 +321,7 @@ bool FontAtlas::prepareLetterDefinitions(const std::u16string& utf16Text)
int adjustForExtend = _letterEdgeExtend / 2;
long bitmapWidth;
long bitmapHeight;
int glyphHeight;
Rect tempRect;
FontLetterDefinition tempDef;
@ -340,9 +341,10 @@ bool FontAtlas::prepareLetterDefinitions(const std::u16string& utf16Text)
tempDef.offsetX = tempRect.origin.x + adjustForDistanceMap + adjustForExtend;
tempDef.offsetY = _fontAscender + tempRect.origin.y - adjustForDistanceMap - adjustForExtend;
if (bitmapHeight > _currLineHeight)
glyphHeight = static_cast<int>(bitmapHeight) + _letterPadding + _letterEdgeExtend;
if (glyphHeight > _currLineHeight)
{
_currLineHeight = static_cast<int>(bitmapHeight) + _letterPadding + _letterEdgeExtend + 1;
_currLineHeight = glyphHeight;
}
if (_currentPageOrigX + tempDef.width > CacheTextureWidth)
{