Mate
#1
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.
dave
#2
Do you have font json file too?
Mate
#3
readded font.json to the project. (I also put the .fnt file in.)
dave
#4
Looks like that JSON file is invalid. It shows a parsing error. I think it is this bit: "face": font
Mate
#6
OK i changed it to “face”: “font”, (added the ")
Should I add an issue to the github repo?
Also, tinting does nothing.
vaios
#7
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