wijesijp Posted July 9, 2018 Share Posted July 9, 2018 I am new to pixijs development. I am trying display some text using Font.js var font = new Font(); font.onload = function() { var title = new PIXI.Text("This is a test", { fontFamily: "48px A.C.M.E. Secret Agent" }); title.position.set(100, 100); gameScene.addChild(title); }; font.onerror = function(err) { console.log("font error " + err); }; font.fontFamily = "A.C.M.E. Secret Agent"; font.src = "fonts/acmesa.ttf"; But I am getting a warning Failed to decode downloaded font: data:application/x-font- OTS parsing error: post: Failed to parse table And the text is not getting displayed with the correct ttf font. Can someone post a simple example showing how to use pixijs with Font.js? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 9, 2018 Share Posted July 9, 2018 Need more information. Also, you can search through pixi github issues and "resource-loader" github issues. Quote Link to comment Share on other sites More sharing options...
wijesijp Posted July 9, 2018 Author Share Posted July 9, 2018 Is there a ttf font loader in pixi? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 9, 2018 Share Posted July 9, 2018 I'm not an expert on fonts. Please search in github "pixi.js" and in "resource-loader" repos. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.