I’ve been having the same issue for a while now for my offline fonts (runtime fonts in UMG are fine). I’ve done some digging using the latest engine version, 4.7.6, and I think I have an answer.
The root of the problem seems to be that an offline font asset isn’t loaded into memory when an actor’s TextRenderComponent is being setup. For me, this happens only on Windows cooked/packaged builds (iOS doesn’t have this issue). Playing in the editor or playing a stand-alone instance through the editor avoids the issue. I suspect the offline font asset is already in memory at this point.
The TextRenderComponent has a property, InvDefaultSize, that is used in the render matrix calculations for the characters to display. Normally, this should be a small number (at WorldSize 26 this is 1.0/26.0, or 0.03846). However, in my cooked Windows builds, I was seeing this value as 1.0 when my breakpoint in AActor::BeingPlay was hit on the offending actor. Digging into the engine source, UTextRenderComponent will set InvDefaultSize to 1.0f in two scenarios:
-
If the font’s GetMaxCharHeight() returns 1 (meaning the characters are 1 pixel tall in the texture sheet).
-
If UTextRenderComponent::SetFont is called without a valid UFont pointer (TextRenderComponent.cpp, line 870). This is the most likely cause.
Only actors I placed in the level seem to have this issue. As a work-around, any actors that have a TextRenderComponent with a custom font should be spawned after the player has entered the level (I do this in my GameMode’s BeginPlay function). There’s a better solution out there (or one that may require a fix in the engine code), but this will at least get you around the problem in the meantime.
Hope this helps someone out there!