bmGlyph and bitmap font for graphics 2.0

hi,

  1.  ok i will try to reproduce it and provide an update. i guess it comes from an unexpected or missing char. i will let you know.

  2.  no sure about that, but i guess it comes from the @2x assets. you might need to use font size 96.  On what device/resolution/scale config are you trying this ?

Stéphane.

Thanks for the speedy answer :slight_smile:

  1. Yeah… I thought so too but I tried only entering alphabets and numbers but it still produced the same broken lua file.

  2. I’m just using the SD version, since I don’t provide any other suffix. The screen is 800x480 (tried it on the several resolution up to full HD). I’m asking to Corona team as well on how do they render their font to get that size.

Anyway, I’m hacking your bmf2.lua file to add a tinting abilities similar to setTextColor since that’s what I’m trying to do (porting normal font to bitmap font).

Thanks

i’ve found the bug, it will be fixed with the next update… (the font has actually no kernings and in that case with the corona2 export, the return line is not written to the .lua file)

Sweet,
Yeah I finally managed to get things working properly. I added the return line and added a nil check for fonts that don’t use kernings and still working to make sure that alignment set properly but other than that everything’s working nicely.

Looking forward for that update

Just delved into the world of bitmap fonts for the first time. I’m getting issues with certain letters not being positioned correctly on the ‘y’ axis, i.e. ‘y’ looks a pixel or two high, while ‘l’ is a pixel or so too low, so the overall effect is wobbly looking text.

Any suggestions as to how to fix this? It’s just a basic font called ‘Futura’ put through bmGlyph.

it might come from the downscaling, it may affect the positioning .  you can fix that by checking the box ‘redraw when downscale’ in the publish settings window.

Thanks, I’m pretty sure I had that checked as it seemed sensible but I’ll double check when I get home.

Hi everyone,

The bmGlyph update is ready (for the non-MAS version, and under review for the MAS version) and it fixes the corona 2.0 export bug which occurred when the font was with no kernings informations.

I have also added a cool feature: shaded material. It Produces a shaded image from a height field. With this effect, you can achieve almost anything you want (sharp emboss, smooth emboss, any 3D material effect with your own material texture like plastics, glass, metals, etc…).

Untitled1.png

hope you will enjoy it :slight_smile:

cool, thanks

Hi,

I’ve just bought bmGlyph 2.1.0 off the Apple Appstore. I’m having problems with the kernings value being null. Tried both ticking and unticking yield the same results. Can anyone help?

This is the error I’m getting off the Corona compiler. 

File: bmf2.lua

Line: 157

Attempt to index field ‘kernings’ (a nil value)

I tried adding in the files from the sample build and it worked. This error only occurred when I tried adding my own custom fonts made with the software.

Thanks in advance!

Edit: I commented out the code from line 157 and it compiled without an issue. However, @2x and @4x scaling isn’t working. All I’m seeing is jumbled graphic. 

just add a nil check should do the trick

I have fixed the bmf2.lua, you can download it from there: https://github.com/tapouillo/bmf2—bitmap-font-for-Corona-graphics-2.0

it should work with the @2x and @4x suffix, can you check your config.lua and compare with the one on the github repository ?

Seems like the sample I’ve downloaded was an older version. Using the files from github fixed my problems. 

It’s working great now. Thanks!  :slight_smile:

Hi squeraud,

I just bought your bmglyph to make sure I can work with 

There are some problems that I found though :

  1. It seems some fonts that I use won’t be exported/published properly. I tried this with several fonts that I’m using and the lua it produced is missing the kernings data (I make sure use kerning is checked) and even the last line “return sheetData”. It seems that it’s broken somewhere and won’t continue writing the file.

The fonts in question are attached here

  1. Since I’m trying to change the fonts in my game to use bitmap, I’m confused on how the fontsize works? I did a test of creating a bitmap font with the size of 48 and compare it side by side with Corona’s font system with the fontsize of 48 as well.

There’s a big difference on the size of the text as shown in the image here CbofE4n.png

What do you think it’s the best way to get the same font size on the screen ?

Thanks
 

hi,

  1.  ok i will try to reproduce it and provide an update. i guess it comes from an unexpected or missing char. i will let you know.

  2.  no sure about that, but i guess it comes from the @2x assets. you might need to use font size 96.  On what device/resolution/scale config are you trying this ?

Stéphane.

Thanks for the speedy answer :slight_smile:

  1. Yeah… I thought so too but I tried only entering alphabets and numbers but it still produced the same broken lua file.

  2. I’m just using the SD version, since I don’t provide any other suffix. The screen is 800x480 (tried it on the several resolution up to full HD). I’m asking to Corona team as well on how do they render their font to get that size.

Anyway, I’m hacking your bmf2.lua file to add a tinting abilities similar to setTextColor since that’s what I’m trying to do (porting normal font to bitmap font).

Thanks

i’ve found the bug, it will be fixed with the next update… (the font has actually no kernings and in that case with the corona2 export, the return line is not written to the .lua file)

Sweet,
Yeah I finally managed to get things working properly. I added the return line and added a nil check for fonts that don’t use kernings and still working to make sure that alignment set properly but other than that everything’s working nicely.

Looking forward for that update

Just delved into the world of bitmap fonts for the first time. I’m getting issues with certain letters not being positioned correctly on the ‘y’ axis, i.e. ‘y’ looks a pixel or two high, while ‘l’ is a pixel or so too low, so the overall effect is wobbly looking text.

Any suggestions as to how to fix this? It’s just a basic font called ‘Futura’ put through bmGlyph.

it might come from the downscaling, it may affect the positioning .  you can fix that by checking the box ‘redraw when downscale’ in the publish settings window.