I am attempting to change the font on a text render object, and then give it an outline.
However I seem to have run into a few roadblocks.
First I downloaded a font from Dafont (just for testing). This one is called Classica, which gives me 4 ttf files.
I import the Classica-Book.ttf, and it becomes an asset of type “Font Face”.
Now I make a new asset of type “Font”, and call it MyFont.
Now when I create a widget, add a canvas and text, and then change the font of the text to MyFont.
It works, no problem. Even outlines work.
Next I create a new blueprint of type “Actor”, and add a “Text Render Component”.
It shows text in the viewport, but when I change the font to MyFont, the text is no longer visible.
After some searching I come across some remarks that speak of making a custom material for the text, and I try this.
From what I read I am supposed to make a “Text Material” but I assume its just a normal “Material”.
I make the material masked and two-sided, and add a “Font Sample” node.
I also add a “Lerp(-90,90)” node and a “Vertext Node” since that is what I see others do.
The “Font Sample” node is set to “MyFont”, and I connect the nodes.
Now it gives an error “[SM6] (Node FontSample) Font Sample> Font ‘MyFont’ is runtime cached, but only offline cached fonts can be sampled”
Apparently I need to go into the “MyFont” asset and change “Font Cache Type” to “Offline”.
This gives me a pop-up, and after that, a window where I must select the font-type I am using.
It is not there, and I give up on this font.
Instead I try a font that is standard on my computer.
I go to “C:\Windows\Fonts” and import the “Impact Regular” font, and repeat the same steps as above, creating a “MyNewFont” asset.
Now when changing the font to “Offline”, I can find the font I need to select.
I can change the font of the “Font Sample” node to “MyNewFont” and it does not give errors.
But now the “Font Sample” is just a white square, and if I use it in the “Text Render Component”, it shows some weird blocks.
And now I am stuck. I dont know how to continue.
How do I get a custom font to work in a “Text Render Component” with outlines?
P.S. I am using Unreal Engine 5.1 with blueprints