diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index 00286da8e199..6256350abd8b 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -72,6 +72,12 @@ FontAtlas::FontAtlas(Font &theFont) _letterPadding += 2 * FontFreeType::DistanceMapSpread; } + auto outlineSize = _fontFreeType->getOutlineSize(); + if (outlineSize > 0) + { + _lineHeight += 2 * outlineSize; + } + #if CC_ENABLE_CACHE_TEXTURE_DATA auto eventDispatcher = Director::getInstance()->getEventDispatcher(); @@ -96,7 +102,6 @@ void FontAtlas::reinit() auto outlineSize = _fontFreeType->getOutlineSize(); if(outlineSize > 0) { - _lineHeight += 2 * outlineSize; _currentPageDataSize *= 2; }