[SOLVED] Font Script broken?

I get an error on runtime when trying to use a font:

SyntaxError: Unexpected token o in JSON at position 101
at Object.parse (native)
at Object._onSuccess (https://code.playcanvas.com/playcanvas-stable.js:16106:23)
at Object._onReadyStateChange (https://code.playcanvas.com/playcanvas-stable.js:16084:16)
at Object. (https://code.playcanvas.com/playcanvas-stable.js:16042:12)

In the editor, I see no text either.
Here’s the project: PlayCanvas | HTML5 Game Engine

I used this site to generate the .fnt file and .png FontAtlas:
http://kvazars.com/littera/

Any settings on export I need to adjust?

Thanks.

Do you have font json file too?

readded font.json to the project. (I also put the .fnt file in.)

Looks like that JSON file is invalid. It shows a parsing error. I think it is this bit: "face": font

OK i changed it to “face”: “font”, (added the ")
Should I add an issue to the github repo?

Also, tinting does nothing.

I think that in the .fnt file it should be written as face=“font” instead of face=font. It’s probably a bug on their end.

Tinting multiplies the color of the font with the color you specify. Better export a white font in order to be able to tint it properly.

1 Like