Laura Posted May 17, 2020 Share Posted May 17, 2020 Hello! I am trying to build my own bitmap font using pixi 5. I was able to draw the letters and form a png file with them (attached file - it's a poor quality drawing, wanting to have some test file quickly). The fnt file is something I downloaded from littera and replaced position, height, width values with the ones I computed for my png file. When I try to load the font, I get the error: core.js:6185 ERROR TypeError: Cannot read property 'size' of undefined at BitmapText.updateText (text-bitmap.es.js:172) at new BitmapText (text-bitmap.es.js:155) I am able to load other bitmap fonts from the internet, so I am sure I am doing something wrong with either png or .fnt file. I haven't found much information on the internet regarding the fnt, so if you have some ideas on what seems wrong, I'd really appreciate it. Do you think this is fixable? Thank you, Laura testFont.fnt Quote Link to comment Share on other sites More sharing options...
Laura Posted May 17, 2020 Author Share Posted May 17, 2020 If anyone faces the same issues, I have discovered the problem. In the fnt file: <font> <info face="testFont" size="72" bold="0" italic="0" charset="" unicode="" stretchH="100" smooth="1" aa="1" padding="0,0,0,0" spacing="0,0" outline="0"/> <common lineHeight="80" base="57" scaleW="361" scaleH="512" pages="1" packed="0"/> <pages> <page id="0" file="testFont.png"/> </pages> ... On line 2, face="testFont" must match the name from line 5 (file = "testFont.png") Apparently, this undefined size error is a facade for anything that might be wrong with the font file. ivan.popelyshev and themoonrat 2 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.