Laura

Members
  • Content Count

    5
  • Joined

  • Last visited

  • Days Won

    1
  1. Laura

    Generate bitmap font

    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.
  2. 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
  3. Thank you for your reply, Ivan! It is very useful.
  4. Hello! I am developing an application with Angular and PIXI JS which generates bitmap fonts using bezier curves. The curves represent the outlines of my letter and supposing I am drawing the letter O as seen in the image I attached (it is not a stylish drawing, but you get the point), I would like to fill in with colour the interior of my drawing - the letter itself. I have not found away to do it. I have tried to create a texture from my graphics and then a sprite from the texture, then adding a tint to the sprite, as follows: const bezierTexture = renderer.generateTexture(this._splineGraphics); // convert shape to texture const sprite = new PIXI.Sprite(bezierTexture); this._stage.addChild(sprite); sprite.texture = PIXI.Texture.WHITE; sprite.tint = 0xFF0000; sprite.width = this._width; sprite.height = this._height; However, this is tinting my entire canvas. Thank you, Laura
  5. Hello! I am developing an application with Angular and PIXI JS which generates bitmap fonts using bezier curves. The curves represent the outlines of my letter and supposing I am drawing the letter O as seen in the image I attached (it is not a stylish drawing, but you get the point), I would like to fill in with colour the interior of my drawing - the letter itself. I have not found away to do it. I have tried to create a texture from my graphics and then a sprite from the texture, then adding a tint to the sprite, as follows: const bezierTexture = renderer.generateTexture(this._splineGraphics); // convert shape to texture const sprite = new PIXI.Sprite(bezierTexture); this._stage.addChild(sprite); sprite.texture = PIXI.Texture.WHITE; sprite.tint = 0xFF0000; sprite.width = this._width; sprite.height = this._height; However, this is tinting my entire canvas. Thank you, Laura