libgdx: BitmapFont markup crashes in TextField

My app crashes when using BitmapFont markup within a TextField instance (not sure if it happens the same in other scenarios): TextField tf = new TextField("[RED]h[GREEN]ello", tfs);

I get: FATAL EXCEPTION: GLThread 8852 Process: es.morse.flash.android, PID: 3177 java.lang.ArrayIndexOutOfBoundsException: length=0; index=0 at com.badlogic.gdx.graphics.g2d.BitmapFontCache.addGlyph(BitmapFontCache.java:628) at com.badlogic.gdx.graphics.g2d.BitmapFontCache.addToCache(BitmapFontCache.java:533) at com.badlogic.gdx.graphics.g2d.BitmapFontCache.addText(BitmapFontCache.java:682) at com.badlogic.gdx.graphics.g2d.BitmapFont.draw(BitmapFont.java:271) at com.badlogic.gdx.scenes.scene2d.ui.TextField.drawText(TextField.java:331) at com.badlogic.gdx.scenes.scene2d.ui.TextField.draw(TextField.java:302) at com.badlogic.gdx.scenes.scene2d.Group.drawChildren(Group.java:111) at com.badlogic.gdx.scenes.scene2d.Group.draw(Group.java:58) at com.badlogic.gdx.scenes.scene2d.Stage.draw(Stage.java:128) at es.my.App.render(MyApp.java:144) at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:416) at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1522) at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239) waiting for pause synchronization took too long; assuming deadlock and killing

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 18 (17 by maintainers)

Most upvoted comments

I don’t see there being a good workaround for this that we can implement in gdx itself. Closing this out.