Missing Fonts in the HUD

I’m following this tutorial/book “Learning C++ by Creating Games with UE4”, and there’s a problem with the HUD. In the Blueprints it gives me the option to choose a font, but there are no fonts to choose from (not even roboto). In the .cpp file its just

void AMyHUD::DrawHUD()
{
	//call superclass DrawHUD() function first
	Super::DrawHUD();
	// then proceed to draw your stuff.
	//Draw Lines
	DrawLine(200, 300, 400, 500, FLinearColor::Blue);
	//Draw Text
	DrawText("Greetings from Unreal!", FColor::White , 0, 0, hudFont, 1, true);
}

and in the .h file is

UCLASS()
class GOLDENEGG_API AMyHUD : public AHUD
{
	GENERATED_BODY()

public:
	//The font used to render the text in HUD
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HUDFont")
	UFont* hudFont;
	//Function to draw to HUD
	virtual void DrawHUD() override;
};

In you font selection drop down menu go to the bottom right part and click on view options, then check the Show engine content option. That will make all the engine fonts appear including Roboto.

Hope it helped. have a nice day!

3 Likes

Thanks, it worked great.