2D Toolkit Forum

2D Toolkit => Support => Topic started by: habitoti on November 26, 2013, 08:50:48 am

Title: Exception on Font Spritesheet Generation
Post by: habitoti on November 26, 2013, 08:50:48 am
Hi,

I am including mono-spaced digits for a score display into a font spritesheet (which already was successfully created for two differnetly sized bitmaps of a regular font). These mono-spaced digits are a bitmap font generated only from digits and some additional characters (.-# etc.), so very small.
Are you expecting certain characters to be in the font on generation of the atlas? Because when I now push "commit", I end up with the following exception:

Code: [Select]
IndexOutOfRangeException: Array index is out of range.
tk2dSpriteCollectionBuilder.Rebuild (.tk2dSpriteCollection gen) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionBuilder.cs:1298)
tk2dSpriteCollectionEditorPopup.Commit () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:446)
tk2dSpriteCollectionEditorPopup.DrawToolbar () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:436)
tk2dSpriteCollectionEditorPopup.OnGUI () (at Assets/TK2DROOT/tk2d/Editor/Sprites/SpriteCollectionEditor/tk2dSpriteCollectionEditorPopup.cs:889)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

NOTE: I additionally just found this only happens when I choose PNG as format for the collection. No exception occurs when I choose "Unity Texture" as atlas format.
Title: Re: Exception on Font Spritesheet Generation
Post by: unikronsoftware on November 26, 2013, 09:51:02 am
This is a known issue with 2.3 which we have fixed in the current version. I hope to release 2.3.1 this weekend with this fix in properly. For now I recommend sticking with normal atlases here - you can revert back to PNG atlases when the fix is released.