UMG - Custom Fonts?

using UMG, I’ve noticed there is an option for fonts, but it isn’t using Windows fonts or imported font assets. How do you go about using a custom font with UMG?

Also, a second question, how can I snap a text block to an exact location? for example, I have a title menu and a settings screen, both containing the title of the game, but currently when switching screens, the title text moves slightly as it is placed by hand.

Thanks.

Hi,
Fonts are found in “Unreal Engine/4.4/Engine/Content/Slate/Fonts”.

Copy whatever fonts you want in there.

To change fonts in a text box, just put for example, “Slate/Fonts/cour.ttf” in the font name setting (after copying the font into that folder).

That’s how I do it anyway.

As far as I know, there is no way to snap right now, but you can set the layout data manually in the details tab.

If you just place them into your games Content/Slate/Fonts/ folder they will be cooked, and you can set their path in the UMG editor to just Slate/Fonts/myfont.ttf. No need to put them into Engine content.

For the second part of the question. Be sure to obtain the size of the screen. This way, you can alright by percentages/fractions.

The trick to put stuff in the middle, is that the the ‘Draw Text’ material, will be drawn from left to right always. To solve this use the ‘Get Text Size’ to get the size in pixels, then you can compensate in your size Y and Size X of ‘Draw Text’.

So, to reitarate. First, get the screen size.

http://puu.sh/b2bKu/3a4cefe84c.jpg

Next, get the size of what you are drawing.

http://puu.sh/b2bRR/37d05165dc.jpg

Finally, do the math’s so that the text aligns properly.

http://puu.sh/b2bVI/794e8e0de2.jpg

That’s the method you should use for AHUD, not UMG. For UMG, you can place the text object on a canvas, and then anchor it to the top center of the screen and set the horizontal offset to be 0. In order to then align the object at its center at that anchor point, change the Alignment to 0.5, 0.5.

Cheers,
Nick

Actually instead of placing it directly onto the canvas, place a Horizontal box down in the canvas first, that contains the text, then you don’t have to worry about sizing the text box. The horizontal box will let you center it easy.

That did it, thanks. great work on UMG, by the way. it’s definitely fun to use and is quite powerful even in experimental phase.

Hi. I added the font in the content foler, and that made the font work in the editor. But, it doesnt work in the standalone build (I get the default font instead). Please help.

I am having the same issue. Please look into it. Thanks.

Found the solution. The fonts need to be put in the Slate folder (inside content)

Thanks. That did it. Awesome.