You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am creating text that contains a tab character (\u0009).
Text used in: Label.
I see good work with space characters, newline characters, etc.
But instead of a tab character, I see a rectangle (an "unknown character" marker).
I want to see only empty space.
Reproduction steps/code
I use Verdana.ttf. And roughly the following code:
val parameters = FreeTypeFontGenerator.FreeTypeFontParameter()
parameters.size = 16
parameters.characters = ... + "\t" // I try manually add tab and try no add
FreeTypeFontGenerator(Gdx.files.internal("Verdana.ttf")).generateFont(parameters)
Version of LibGDX and/or relevant dependencies
gdxVersion: '1.9.11'
Please select the affected platforms
Android
iOS
HTML/GWT
Windows
Linux
MacOS
PS
As far as I suspect, the tab character has a non-zero height in the font (as opposed to the space character). Probably the problem is related to this. It probably makes sense to handle special characters in a special way. Probably in some fonts they may be drawn differently, or ignored.
platofrm: java (desktop app on linux)
The text was updated successfully, but these errors were encountered:
So... the tab character is definitely a "special" character. Probably the most helpful suggestion I can give is to replace any tabs in your Label text with the desired amount of spaces (maybe 2, 4, or 8), and hope you don't need tab stops. The problem, I think, is that tab is a control character that renders differently depending on context; text editors allow setting tab width, and word processors allow specifying tab stops. I don't think libGDX has any way of specifying either tab width or tab stops, so tab just becomes an unknown or unknowable character when rendered. This might be a limitation of FreeType or of the libGDX BitmapFont/Label code, I don't really know. The good news is that if your tabs are all in a file of the game's text (such as an I18N bundle), it should be a quick step to replace \t (the tab character itself) or \\t (an escaped tab) with, say, (four spaces). It is far from ideal, but it should look better than the unknown character glyph.
Issue details
I am creating text that contains a tab character (\u0009).
Text used in: Label.
I see good work with space characters, newline characters, etc.
But instead of a tab character, I see a rectangle (an "unknown character" marker).
I want to see only empty space.
Reproduction steps/code
I use Verdana.ttf. And roughly the following code:
Version of LibGDX and/or relevant dependencies
gdxVersion: '1.9.11'
Please select the affected platforms
PS
As far as I suspect, the tab character has a non-zero height in the font (as opposed to the space character). Probably the problem is related to this. It probably makes sense to handle special characters in a special way. Probably in some fonts they may be drawn differently, or ignored.
platofrm: java (desktop app on linux)
The text was updated successfully, but these errors were encountered: