UMG - Kerning whilst zooming is terrible on kerned pairs?

So, I seem to have an issue with kerned pairs (like TO, YO etc) whilst simply zooming in the editor. As you can see from my images below, at 1:1 zoom, everything is fine and as expected. When I get to -8 zoom, kerned pairs seem to go ballistic and start overlapping. I can only assume this hasn’t been taken in to account whilst re-rendering the viewport? This is VERY large text (162pt) though I’m not sure that has anything to do with it.

I guess it’s not a huge bug (not tried to PIE yet) but it definitely needs looking at - it makes layout somewhat difficult when you are working on a monitor that has a lower res than your intended resolution.

I’m pretty sure this was fixed for 4.11. FreeType’s scaled kerning seemed to produce some very bad results, so we resorted to scaling the kerning ourselves.

Are you able to test a copy of your project against 4.11 to verify this?

I’ll do that - problem is we are stuck using 4.10.4. My next question is, can we integrate those changes made in 4.11 back to 4.10 ourselves?

You can’t really merge it because the font cache was re-organised between 4.10 and 4.11 to support shaped text, however you should be able to remake the changes in FFreeTypeInterface::GetKerning (FontCache.cpp).

Replace this:

FT_Error Error = FT_Set_Char_Size( FontFace, 0, InSize*64, FontCacheConstants::HorizontalDPI, FontCacheConstants::VerticalDPI  );

if( InScale != 1.0f )
{
	FT_Matrix ScaleMatrix;
	ScaleMatrix.xy = 0;
	ScaleMatrix.xx = (FT_Fixed)(InScale * 65536);
	ScaleMatrix.yy = (FT_Fixed)(InScale * 65536);
	ScaleMatrix.yx = 0;
	FT_Set_Transform( FontFace, &ScaleMatrix, nullptr );
}
else
{
	FT_Set_Transform( FontFace, nullptr, nullptr );
}

With this:

FT_Error Error = FT_Set_Char_Size( FontFace, 0, InSize*64, FontCacheConstants::HorizontalDPI, FontCacheConstants::VerticalDPI  );
FT_Set_Transform( FontFace, nullptr, nullptr );

Replace this:

// Return pixel sizes
Kerning = KerningVec.x / 64;

With this:

// Return pixel sizes
Kerning = FT_MulFix(KerningVec.x, InScale * 65536) / 64;

That worked brilliantly, thank you.