UE4 `stat SceneRendering` small font problem

By default, when displaying stats with stat SceneRendering command,  small font is used which is readable enough. But if the viewport width is less than 1280px (which is the case for my editor viewport), the font is initialized to the tiny version.

UE4Editor-Win64-Debug_2017-06-30_16-41-48
Tiny font

One possible solution is to disable this behaviour by commenting out these lines:

StatsRenderer2.cpp, Initialize()

/*if( SizeXY.X < 1280 ) 
{ 
  SetNewFont( EStatFontTypes::Tiny ); 
}*/

Recompile the engine, run the editor, exec stat SceneRendering and you should see text in bigger font.

UE4Editor-Win64-Debug_2017-06-30_16-38-44
Small font

Here’s a sequence diagram showing how the stats get drawn. During gameplay the FEditorViewportClient would be replaced with FGameViewportClient.

Leave a comment