How do I import and use custom fonts?

Hello, UE4 community! I’ve been using UE4 and so far I really enjoy it, but I can’t seem for the love of me to get fonts working… I do the right click → materials and textures → fonts in the content browser, and it does not matter what font I import, every time I apply that font to any text renders, it turns it into a bunch of incomprehensible symbols. I’ve tried messing around with different fonts, sizes, text, even colors to no avail… I’m sure I’m doing something wrong, I just don’t know what it is. If you’d be so kind, you could tell me how you’d go ahead and use your font on some text in-game step-by-step, just in case. Thank you for your time.

Thanks for replying. I’m guessing we’re not the only ones experiencing this, so it’ll probably be fixed eventually.

I’m seeing this too, the UV offsets are all wrong for the resulting font file, so you get random bits of adjacent characters. I’ve tried several different fonts to no avail.

Yes, it still didn’t work.

Did you create a new Text Material which references the corresponding font?

This is a long story… but the steps outlined below work for me at any rate.

First of all, a font imported the ordinary way will in fact work fine, but not for a TextRenderActor specifically.
However, if you use it in a DrawText node in the HUD blueprint, it will perform as expected. Just wanted to point that out.

Anyway - to make a font for TextRenderActors, do this:

  1. Import your font as per usual, and rename it to something like “{your_font_name}DistanceField” to make it easier to tell it from an “ordinary” font later on.
  2. Open the newly imported font by double-clicking it in the Content Browser.
  3. In the Details panel of the Font Editor, search for “Distance” and you’ll find a checkbox labeled “Use Distance Field Alpha”. Check that box now.
  4. In the “Asset” menu of the Font Editor, click “Reimport {your_font_name}DistanceField”
  5. Wait for it to process. This can take quite a while. It seems like a good idea to make the initial import at a moderate point size, like 20 - 24 or something, to keep the number of font pages down. Otherwise the reimport turns into a good opportunity to take a lunchbreak. So, a simple font with a minimal glyph set is a good thing in this context.
  6. Save and close the Font Editor when the reimport is complete.
  7. Now place a standard TextRenderActor into your scene by dragging it from the Modes panel.
  8. In the Details panel, you’ll find that the TextRenderActor uses a material called DefaultTextMaterialOpaque. This is part of the Engine contents, not visible by default in the CB. Click the magnifying glass icon to browse to the asset in the content browser.
  9. The engine contents should automatically load in the CB, and the material in question is highlighted.
  10. Drag it into your Game folder and select the ‘Copy’ option when prompted.
  11. Rename your copy to ‘MyTextMaterial’ or something equally imaginative… Then open it in the Material Editor.
  12. In the Material Editor, select the Font (Font Param) node and change the name of the font in the Details panel to the name of your font.
  13. Apply, save and close the ME.
  14. Back in the level editor, select the TextRenderActor again and change its material in the Details panel to your new ‘MyTextMaterial’
  15. In the Text section (still details panel) set the correct font in the Font drop-down. This seems a bit reduntant, but it appears necessary from what I’ve seen here.
  16. Enter your text and marvel at: a) your new font in the scene, and b) the fact that you’ve just read and followed all these instructions (and that someone posted them).

It is quite possible that I’ve inadvertently left some step out, but this should probably get you going in the right direction.

1 Like

Thanks! I’d hate to wonder how you found out how to do all that >.<

You’re welcome. Please mark the topic as Resolved if my solution worked for you.

Where do I mark it as resolved?

Sorry… But it won’t work. It still gives me weird hieroglyphs, except this time around they look different. I’ve tried with multiple fonts to no avail.

Sorry for the trouble. I fixed it. I accidentally forgot to switch the font inside the material… Thanks xD

Maybe you’re going too big? Ideally, the standard set of alphanumerical glyphs should fit on one texture page. Try a perfectly normal font like Tahoma at size 20 for instance:

No trouble at all. Glad you got it working. Fonts are important stuff.

There is a checkbox up near the answer, under the votes, visible only to you.

Aw jeez. thanks for showing me how to do line breaks :smiley:

Thanks! it works

Not working for me. Still getting weird symbols. Engine 4.4.0 and 4.2.1. Any other way ?

The Tappy Bird game uses custom fonts for TextRenderComponents, with its own blueprint for making text materials. I’m not 100% pleased with the results applied to the font I’m using, but its pretty straightforward to copy.

Not working for me. I’m using 4.5. (preview)

I tried the below answer 3 or 4 times now (double checked all textures, fonts and materials)

I tried Arial at 20 and 100, and my custom other font. Neither are working. Is there any other options that I need to set for import other than the Distance Field check box?

Not working for me in 4.5 on OSX. I tried Tahoma. With some fonts I can just about see the right characters but they are rendered at crazy heights up and down. Others I just get random glyphs. Did anybody get this to work on OSX? The standard font works fine but any imported fonts render corrupted. I followed all steps above several times.