UE4.6 - Get Text Size returns 0 for default UE font

Using DrawText with font selected will use the default UE asset.
I assumed that calling [Get Text Size] with font selected would also return the size of the default UE font asset but it does not, it returns zero.

If I want the size of the default UE font I have to include it (TinyFont). This is fine, but if in future UE decide to change the default font fron TinyFint to somethign else then my setup will be erroneous.

Fyi, I cannot directly use the TinyFont asset in DrawText due to pending scaling issues one and two and don’t know if they have been (will be) fixed in 4.7

I’ve added the same fallback check to GetTextSize when the font is null. fda57399ab363be59c18c17ffc87160f7dac2ae9

I also took a look at your linked issues. The font scaling is working for 4.7 (I commented on one of the issues regarding the quality), and I’ve also added UE-10535 suggesting we add a way to give a FSlateFontInfo to DrawText, as this will allow you to override the font size and typeface used when using a runtime cached font asset with Canvas (like you already can with C++).

Great! Thanks Jamie.

Hi, is this really fixed in 4.8.3? I am trying the following C++ code:

float width = 0.0f, height = 0.0f;
HUD->GetTextSize("String", width, height);

However, both width and heightt variables are always 0.
So I tried the following instead:

float width = 0.0f, height = 0.0f;
HUD->GetTextSize("String", width, height, GEngine->GetMediumFont());

But without luck, both width and height are still 0.
Any ideas?