How do I import and use custom fonts?

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.

2 Likes