2D Toolkit Forum

2D Toolkit => Support => Topic started by: clckwrk on July 15, 2012, 07:22:05 pm

Title: Can't use custom font in TextMesh
Post by: clckwrk on July 15, 2012, 07:22:05 pm
So I followed the instructions for how to import a font, but now whenever I try to create a tk2d TextMesh I get this error:

Code: [Select]
IndexOutOfRangeException: Array index is out of range.
tk2dTextMesh.GetMeshDimensionsForString (System.String str) (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:543)
tk2dTextMesh.FillTextData () (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:244)
tk2dTextMesh.Init () (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:384)
tk2dTextMesh.Commit () (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:456)
tk2dTextMeshEditor.OnInspectorGUI () (at Assets/TK2DROOT/tk2d/Editor/Fonts/tk2dTextMeshEditor.cs:166)
UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty)
UnityEditor.InspectorWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
UnityEditor.PopupCallbackInfo:SetEnumValueDelegate(Object, String[], Int32)

I've attached what it looks like, as well as how I've set up the font.

The included fonts render properly, this only happens when I select my custom font.


And ideas? Thanks!
Title: Re: Can't use custom font in TextMesh
Post by: unikronsoftware on July 15, 2012, 08:11:24 pm
How did you generate your font? It looks like you've dragged a Unity Font into the bmFont slot, where it should be a BMFont (xml or text, doesn't matter which).
Title: Re: Can't use custom font in TextMesh
Post by: clckwrk on July 15, 2012, 09:10:38 pm
Ahh thanks I didn't realize there was a difference.