Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: alexh0101 on March 13, 2015, 12:28:03 PM

Title: How can I avoid using a 1024x1024 atlas when my font file is twice as small?
Post by: alexh0101 on March 13, 2015, 12:28:03 PM
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?

Title: Re: How can I avoid using a 1024x1024 atlas when my font file is twice as small?
Post by: Seroster on March 13, 2015, 12:48:38 PM
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.
Title: Re: How can I avoid using a 1024x1024 atlas when my font file is twice as small?
Post by: ArenMook on March 13, 2015, 10:05:59 PM
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.