Custom Fonttype UI Canvas

Amory Crashes once custom Font is added.

I was able to change the font of a UI Text element, by importing a .ttf (TrueTypeFont) file into the asset section of the UI editor. It also worked to change the font, by selecting the text Element and under asset selecting the imported font file.

But then, when I build the game (by pressing F5) the opened window just gets white and closes itself.

Then I’ve looked at the system console and there was something about a unknow image type

Does someone of you know what I’ve made wrong, or is it a bug?

That a bug, because armory is excepting an image.
And also, you are using you are using old Armory2D, update to latest

1 Like

Ok thanks.

Do you know how to report the bug?

It is already reported here

1 Like

You can replace “font_default.ttf” in “ArmorySDK\armory\Assets” :slightly_smiling_face:


This is very good as a temporary measure. :slight_smile:

You can now add custom font when adding canvas:

var canvas = new CanvasScript("NameOfCanvas", "font.ttf");
//Canvas will default to default font if font parameter is not specified.
//Note: font file need to be in `Bundled` folder in order to get detected.

(see PR)

Will give another try to be able to set font from Armory2D and this change to appear in game without having to specify font in CanvasScript()