Hello Guest

Author Topic: Creating a font for different platforms using an existing sprite collection  (Read 3886 times)

ortolan

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Hi,

I'm having difficulty in creating a font that appears at different resolutions (@1x, @2x, @4x) for different platforms from within a sprite collection where the current sprites appear correctly at the correct resolutions when I change the option in 2dtoolkit prefs.




I've previously used the standard way of creating a font using Glyph designer, and following the instructions here;

http://www.2dtoolkit.com/docs/2.5/tutorial/preparing_a_font.html

Which in the past has produced good results, although going down this route recently has meant reducing the scale on the text mesh to .3 to get less blurry text;






However when I use Glyph Designer and try to create a font using an existing sprite collection, setup with 3 different platforms (1x, 2x, 4x) I can't see the font in the 'textmesh' drop down, and I get errors saying 'unable to find platform specific font...'

error message;


'test font' in sprite collection;





'test font' data/material info;












Camera setup;






I think I'm not understanding how I can get different image sizes out of Glyph designer to accommodate the 3 platforms (@1x, @2x, @4x). For a texture in a sprite collection I would normally just start with the 4x image and reduce it using photoshop to create the 1x and 2x images. But 2d toolkit doesn't seem to see the other platforms (2x, 4x), and Glyph Designer's BM font has specific measurements relating to the image saved.

So I have 2 problems;

If I go down the standard font route at the moment I get blurry text unless I scale it down.

If I try to create/use a font via a sprite collection, it doesn't show up in the drop down menu for a 'Text Mesh' and produces errors.

I've tried 'Rebuild index' and 'Rebuild all sprites' to no effect.

I'm sure I'm not quite understanding something basic. Hopefully someone knows an answer.

Many thanks.



unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
You will need to export the font 3 times from glyph designer at the 3 different sizes, i.e. you will need 3 corresponding test_font.fnt files, one for each platform. This doesn't work with just exporting the texture at 3 different resolutions.

ortolan

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Many thanks! Thought I was missing something.  :-\

For anyone else who may have made my mistake; I exported the font from Glyph Designer at 3 different sizes (including the 3 associated fnt files). I then created a font in an existing sprite collection, added the @1x font texture and fnt file, when I then committed the texture it picked up the 2 higher res/larger fonts at 2x and 4x.

3 imported fonts;


font at 1x in existing sprite collection;