Wow, this is cool

@t0neg0d said: The BIGGEST issue I'm having at the moment with BitmapFont, is the lack of JavaDoc info for methods. It's like bobbing for apples without the unsanitary condition.

Yeah, the biggest issue I have is that BitmapFont and BitmapText both calculate text size, letter position, etc. separately. So every time I fixed a bug with kerning or advance in one, I had to go fix it in the other, too. More over, if BitmapFont provided a convenient way for us to put text in and get glyph placement out then it’s easier to do lots of stuff… like roll your own custom ‘bitmap text’ if you have special needs and so on.

Apparently a long time ago all of this magic was in BitmapFont and then was moved out into BitmapText… but it was locked away inside BitmapFont instead of exposed. I think that was the real issue.

@pspeed said: Yeah, the biggest issue I have is that BitmapFont and BitmapText both calculate text size, letter position, etc. separately. So every time I fixed a bug with kerning or advance in one, I had to go fix it in the other, too. More over, if BitmapFont provided a convenient way for us to put text in and get glyph placement out then it's easier to do lots of stuff... like roll your own custom 'bitmap text' if you have special needs and so on.

Apparently a long time ago all of this magic was in BitmapFont and then was moved out into BitmapText… but it was locked away inside BitmapFont instead of exposed. I think that was the real issue.

When you say text… you mean individual character, correct? Does this currently return the Character(not data type… I guess it’s called BitmapCharacter), which has getAdvance, getKerning(float), getX, Y Width & Height? Or were you thinking that this should work differently?

On a related note, I’m having a hell of a time determining the line height appropriately. getHeight doesn’t do what I was thinking it did. What I need is:

baseLine to Top + baseLine to Overhang, I’d like formatting space between lines to be separate.

What getHeight looks like it is returning is 2* the actual renderSize of the character.

Any idea how to do this?

EDIT: I mean getLineHeight… gah… let me verify I am calling getLineHeight (from font… or CharacterSet… can’t remember which)

EDIT 2: Actually, it’s worse than that… I’m getting the same value back from:

font.getCharSet().getLineHeight();
font.getCharSet().getRenderSize();

And both have extra space at the bottom, if using this as line height.

EDIT 3: It looks like getBase() IS the baseline+overhang. Interesting.

@t0neg0d said: When you say text... you mean individual character, correct? Does this currently return the Character(not data type... I guess it's called BitmapCharacter), which has getAdvance, getKerning(float), getX, Y Width & Height? Or were you thinking that this should work differently?

Dealing with a single character is less useful because kerning is character-to-character. To get it right you have to know where you’ve been and where you are going.

The general idea would be to give BitmapFont some kind of processGlyphs() method that took a string and a caller-provided GlyphProcessor. It would then call your GlyphProcessor for each character in the string with the appropriate location, glyph info, etc… BitmapText could use this to update its letter quads instead of the convoluted mess it has now.