I know what you mean.
Happens to me also all the times.
When the font gets rendered with the TextRender component it somehow fetches the glyphs from the wrong positions.
If you use offline caching for the font, the nyou can access the glyph location array in the details panel. Just check where UE4 thinks the glyphs are.
So what you are seeing are “random” patches of the font texture, which makes it look like alien sanskrit…
I havent found a solution either
KVogler, solution for your issue is quite simple. You need to create your own Material to be used with your font. You may copy DefaultTextMaterialOpaque (it is on your screenshot on TextRenderComponent), rename it and change font it is using to be your font.
This solution was explained here on Answerhub
Hope this will help.
I modified the material to be Masked Unlit since it’s a 2D game. This seems to work fine for the default robotodistancefield font but when I change to my font the material just shows up as a white circle, and the font itself is a black block when used in viewport.
The only immediate difference I’m noticing between my font and the robotodistancefield is that mine looks normal as shown in the ftFixedsys screencap while robotodistancefield has a blurry outline and has “Use Distance Field Alpha” checked. I’m wondering if that’s part of the issue?
Yeah, that may be a part of the issue. Every time you change something in your Font settings, you have to save and then reimport that asset, so editor will actually regenerate atlas texture.
You also need “Use Distance Field Alpha” enabled on your font to be useable with TextRender component.
There are 2 ways to bring text into your game (actually 3, but using AHUD functions is a bit outdated):
— TextRender component. It can be placed in arbitrary place in your world, so text will be moving on screen as you move the camera. Requires Distance Field Font and a Material to work.
— UMG / Slate widgets. It can be placed in arbitrary place on your screen, so if you need to attach text to some object in world, you’d have to move the widget by yourself. Requires NON Distance Field Font to work.
It’s up to you to determine what better suits your game.
The text will be sliding in and out on occasion so I probably need to use a textrender. I’m not sure that it’s entirely a distance field issue though. Why would the material show up as a white circle instead of as a texture with the font like the built in robotodistancefield text does?
EDIT AGAIN: Think I figured it out, testing and will post solution.
I’m still waiting on some stuff to compile and if it all works out I’ll follow up with pics and steps.
If you’re first making a Font Asset and importing from your system you will be prompted to choose a font size, type, and the font itself. For a reason unknown to me if I set the size as 22 or higher the font becomes chopped up, but 20 seems safe. Keep in mind the larger you set the font size to the longer it will take to complete the next step. But, larger sizes seem to do better when using larger font size in your game.
After you see your font without any effects scroll down under Offline Font details and click “Use Distance Field Alpha”.
Note: I had already applied the Use Distance Field Alpha effect on the image below. See the image right after this one for what your font should look like right after importing.