Quality of Text and bitmapText
See original GitHub issueExpected Behavior
Text and BitmapText should be visually equal to a Sprite with the same text and same styles.
Current Behavior
The bitmapText and Text are not equal, and not equal to an Sprite with the same text and style.
- Black: The image from photoshop with the same default settings found in PIXI.TextStyle ( except font size, see the settings bellow)
- Red : BitmapText using bitmapFont
- White: Text
Steps to Reproduce
https://jsfiddle.net/Bouh/avogx4n1/2/
Environment
pixi.js
version: dev branch and 5.3.3- Browser & Version: Chrome 85
- OS & Version: w10
- Running Example: https://jsfiddle.net/Bouh/avogx4n1/2/
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (10 by maintainers)
Top Results From Across the Web
Quality of Text and bitmapText · Issue #6884 · pixijs ... - GitHub
Text and BitmapText should be visually equal to a Sprite with the same text and same styles. Current Behavior. The bitmapText and Text...
Read more >new PIXI.BitmapText (text, style) - PixiJS
Advantages can include sharper image quality (like text) and faster rendering on canvas. The main disadvantage is movement of objects may appear less...
Read more >PIXI.BitmapText
A BitmapText object will create a line or multiple lines of text using bitmap font. ... Advantages can include sharper image quality (like...
Read more >Text vs BitmapText ( performance ), the conclusion ? - Phaser 2
BitmapText is really just a spritesheet. Text is rasterizing font glyphs on a canvas. And in WebGL there's the extra step of uploading...
Read more >Bitmap Text object - GDevelop wiki
A Bitmap Text displays a text using a “Bitmap Font” (an image ... Note that the rendering quality can be affected, because the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I hit this issue and came up with an awful solution. I extract the font texture to a buffer, clip the values, and put it back in the BitmapFont.
If you have a
PIXI.settings.RESOLUTION
> 1, set it to 1 before this snippet and back to your resolution after.That example is complicated, let’s simplify it more without Pixi: https://jsfiddle.net/bigtimebuddy/sc8pgL07/
Inherently, rendering text on canvas without antialias &
fillText
is not possible (unless someone figured this out). If you need a pixel-looking font, you should probably use a bitmap-font generation tool (e.g. bmGlyph) which probably has more options or there are some approaches where you scale render it at a large size and scale down.Related: https://www.html5gamedevs.com/topic/23136-how-to-disable-font-antialiasing/
The best I could do it by picking the right sizes plus nearest scaleMode. But it’s not perfect. https://jsfiddle.net/bigtimebuddy/wmkxsgcq/