Slate: Styles and fonts
I'm having a weird problem with Slate and styles.
I have my Slate UI up and running and I've set up styles that the UI loads and adopts. Everything works perfectly, except for one single thing: fonts!
When editing the Style in the editor, I've set the option of being able to change the font style of a widget. When I step through the code in the debugger I can see that it has the correct info in the style, but Slate can't seem to find the font I requested in the style settings.
I've tried with the font name alone (excelate.ttf), with a relative path from Content (UI/Fonts/excelate.ttf) and neither works.
I've tried to hardcode the font with a full path in the code, and it loads perfectly - but I'd really like to be able to give the designers ability to edit the font style from the editor through Styles.
Is there something I'm missing? An ini-file setting that sets up the root directory for Slate to look for assets in, or something like that?
Where does Slate look for fonts by default? I've tried copying the font file to Engine/Content/Slate/Fonts and still no go there either.
Hope one of you guys can help!
Thanks in advance!
If by "in the editor" you mean via a Slate Widget Style asset, then unfortunately fonts cannot currently be set that way as we don't yet have a font asset that will work with Slate.
Fonts must currently be set in the style set for your game via C++. Both ShooterGame and StrategyGame have an example of doing this.
I realise this is an inconvenience, and it is something we are working to address for a future release.
answered Apr 02 '14 at 09:01 AM
Jamie Dale STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here