Yeah, that’s what I thought I asked before. If it’s absolute pixel height then I would assume (for ease of use) that you could fall back on “A” to set font size. Sure, it might not always look perfect, but it’s better than an assert.
Now then, I bought bmGlyph and tried building a basic font from an existing .TTF. It’s showing up extremely blurry despite there being @2x and @4x assets, as if only the 1x asset is being used. I’m not entirely sure why, yet, but I am noticing some problems. Note that this is with both custom TTF and OSX standard TTF; I seem to have the same problem across every font I’ve tried.
1. You need to pass on padding data from the .fnt file to graphics.newImageSheet (.border). (Needed to fix OpenGL bleed artifacts)
I’m not entirely sure but I think in bmGlyph padding would be a combination of Bounding Box and Padding, as padding doesn’t seem to apply along the extreme edges of the texture. (The .fnt file carries both padding and spacing on the first line; not sure which is which…)
- I’m noticing two specific problems: heavy blur (again, looks like only 1x assets in use) and the y offset is off on everything, giving a jumpy look where the text dips up and down.
Specific bmGlyph output options:
This generates the -, @2x, @4x assets.
a. If I turn on “Align to Grid”, the glyphs are all enormously spaced out, which makes me wonder what happens to the offsets when one does this.
b. Although the publishing wizard makes it easy to setup the 3 resolution outputs, choosing a project type doesn’t seem to make a difference for the purposes of font manager. cocos2d+bmfont or corona presets both give the same output files.
Looking at your provided demo fonts:
-
They all work, and look sharp (no 1x blurriness)
-
Substantial naming differences between the texture and .fnt files, which is not wrong, but a bit weird…
-
I can’t be entirely sure but there looks to be (some) similar y-offset problems with the demo fonts. For example, on demofont the interior lowercase all seem to be lifted.