2D Toolkit Forum

2D Toolkit => Support => Topic started by: robot-d on January 27, 2015, 12:39:20 am

Title: Font can't find platform specific texture
Post by: robot-d on January 27, 2015, 12:39:20 am
I can create sprite sheets for different platforms fine, but when I try to create on for a font I seem to get an error when I add the 2x size and click "commit." I can add the full-size (4x) font to my stage without a problem. My Font and all of the data files are in the folder /Assets/SpriteCollection/Fonts/FontName/. The "current Platform" for the sprite sheet is 4x. Here are my steps after that:


I then get this error:

UnityEngine.Debug:LogError(Object)
tk2dEditor.SpriteCollectionBuilder.PlatformBuilder:LogNotFoundError(String, String, String) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionPlatformBuilder.cs:285)
tk2dEditor.SpriteCollectionBuilder.PlatformBuilder:UpdatePlatformSpriteCollection(tk2dSpriteCollection, tk2dSpriteCollection, String, Boolean, Single, String) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionPlatformBuilder.cs:231)
tk2dSpriteCollectionBuilder:Rebuild(tk2dSpriteCollection) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionBuilder.cs:611)
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)
UnityEditor.DockArea:OnGUI()


Any help would be greatly appreciated!  ;D
Title: Re: Font can't find platform specific texture
Post by: unikronsoftware on January 27, 2015, 11:19:33 am
You can't just rescale the font texture. From the docs -
http://2dtoolkit.com/docs/latest/advanced/platform_specific_sprite_collections.html

Quote
The same rules apply to fonts. 2D Toolkit will now parse your bmfont to find the appropriate texture, so you won't need to rename the texture. If in doubt, export from your font package using the full @platform filename instead of renaming it once it has been exported.

Basically, you export your fonts at 2x into the folder (you'll need a 2x .fnt file as well)
Title: Re: Font can't find platform specific texture
Post by: robot-d on January 27, 2015, 02:45:15 pm
Ah that makes sense. Thank you.