Jump to content

Bitmap fonts and anti-aliasing


PLAYERKILLERS
 Share

Recommended Posts

I've noticed some strange behavior with bitmap fonts. For example the Press Start 2P font is originally a 8px font if I am not mistaken. Yet in the examples provided the font is 32px. This is fine when just using ascii or even Latin1 + Cyrillic from Google fonts. But when I include 12px Japanese glyphs it makes sense to scale everything down to 12px. 

https://fonts.google.com/specimen/Press+Start+2P

http://mplus-fonts.osdn.jp/mplus-bitmap-fonts/

After combining the two in fontforge I generate the image with bmfont. Yet at 12px the anti-aliasing in melon.js destroys the void spaces in letters like 'e' or 'a'. When I examine the generated image, I can see that there is an adequate void and that bmfont has produced an acceptable image. 

My conclusion is that melon.js has anti-aliased the font before scaling the image up. For me this seems like a bug. If anti-aliasing is applied globally by default, perhaps it should be applied after the sprites are scaled?

Otherwise, I have a somewhat acceptable result with an internationalized 24px bitmap font taking up an entire 2048x2048 texture. Something about it seems wrong, and I doubt that native Japanese users will find the result satisfactory. 

It has been hard to maintain readability and the retro look.

Link to comment
Share on other sites

interesting..... !

there is an antialias option when calling me.video.init, that is actually (or should be in theory) false by default, would you try to force it to false ?

also are you using the canvas or webgl renderer (the latter still has a few issues that needs to be worked out), if yes can you also try to force the CANVAS one instead  ? (either by removing the renderer option from the me.video.init properties list, or just change it to me.video.CANVAS).

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...