Author Topic: How can I avoid using a 1024x1024 atlas when my font file is twice as small?  (Read 4814 times)

alexh0101

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 30
    • View Profile
It seems that a font HAS to be part of an atlas to work in NGUI, is that right?

My problem is that I only use one font in the atlas and its file is 1024x650. So putting it in a 1024x1024 pixel atlas would be a waste of disk space.

Is it possible to use the font as a 1024x650 pixel image file?
Alternatively, is it possible to reduce the size of the Atlas to 1024x650?


Seroster

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 6
    • View Profile
I'm not Aren, but - not likely.

There is not going to be much disk space wasted.  However you are going to deliver your app, the texture ought to end up being compressed on disk.

I think chances are also high that the graphics card of the device you are building for (e.g. iOS) only deals with textures which are a power of 2 in size (256x256, 1024x1024, etc).

However, if you aren't using Dynamic fonts then I think you might be able to put the font into an atlas along with other graphics.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Bitmap font doesn't need to be a part of the atlas. You can make it use a stand-alone texture. Don't specify an atlas when making a bitmap font.

Power-of-two texture dimensions are generally recommended regardless. Not all devices support non-power-of-two textures.