Fix kerning for SDF scaled fonts in font_manager.cpp (#3192)
Kerning is now also scaled with the scaled child font when using SDF fonts. In examples/common/font_manager.cpp kerning was visibly off when scaling SDF font down.
This commit is contained in:
parent
de9f4b3385
commit
a23b128ae2
@ -522,7 +522,9 @@ float FontManager::getKerning(FontHandle _handle, CodePoint _prevCodePoint, Code
|
||||
if (isValid(cachedFont.masterFontHandle))
|
||||
{
|
||||
CachedFont& baseFont = m_cachedFonts[cachedFont.masterFontHandle.idx];
|
||||
return baseFont.trueTypeFont->m_scale * stbtt_GetCodepointKernAdvance(&baseFont.trueTypeFont->m_font, _prevCodePoint, _codePoint);
|
||||
return baseFont.trueTypeFont->m_scale
|
||||
* stbtt_GetCodepointKernAdvance(&baseFont.trueTypeFont->m_font, _prevCodePoint, _codePoint)
|
||||
* cachedFont.fontInfo.scale;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user