Skip to content

Commit

Permalink
Fixed Bitmap fonts don't display in Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
62316e committed Mar 22, 2019
1 parent cec6e5c commit e0ff118
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/drivers/BitmapTextRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ class BitmapTextRenderer extends Renderer {

const w = texture.width;
const h = texture.height;

// skip empty char (space for example)
if (w === 0 || h === 0)
continue

const ox = texture.untrimmedRegion.x + charData.xOffset + cx;
const oy = texture.untrimmedRegion.y + charData.yOffset + cy;

Expand All @@ -94,7 +99,7 @@ class BitmapTextRenderer extends Renderer {
if (this.texture === null)
this.texture = new Texture(cvs);
else
this.texture.set(cvs);
this.texture.set(cvs);
}
}
}

0 comments on commit e0ff118

Please sign in to comment.