Author Topic: Error: Failed to generate dynamic font texture........  (Read 10835 times)

pad406

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 62
    • View Profile
Error: Failed to generate dynamic font texture........
« on: July 21, 2014, 05:24:46 PM »
I'm getting the below error, it usually only happens the 2nd and subsequent time I run from the editor, but every time on IOS or Android. And on Android and IOS the fonts/characters are all weird.

Failed to generate dynamic font texture, because all the needed characters do not fit onto a single texture. Try using less text or a smaller font size.

It suggest using less text or a smaller font, both of which I have experimented with to no avail. The app is basically a set of headings that when you click on them, expand out (via a tween) a set of options. Some of the screens would have quite a lot of text, but I have brought it back to just 2 topics, each with about 5 options and still get the same error. I am currently using Veranda font, but have tried with one of the NGUI fonts also. There's nothing on the fonts, no gradients, shading or anything like that. The error traces back to this line in NGUIText.cs:

  1. #if DYNAMIC_FONT
  2.         if (dynamicFont != null)
  3.             dynamicFont.RequestCharactersInTexture(text, finalSize, fontStyle);
  4. #endif

One other thing, the vast majority of the text is not dynamic, they are either set to clamp content or resize height freely.

TIA

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Error: Failed to generate dynamic font texture........
« Reply #1 on: July 21, 2014, 06:41:11 PM »
Make sure that the "keep crisp" option is not used on any of your labels. You mentioned scaling things, and that's the first thing that comes to mind. You need to ensure that you use as few font sizes as possible. Pick a few, and stick to them. For example size 20, 26, and 32.

pad406

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 62
    • View Profile
Re: Error: Failed to generate dynamic font texture........
« Reply #2 on: July 22, 2014, 04:23:36 AM »
Thanks, I'll try that this evening

pad406

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 62
    • View Profile
Re: Error: Failed to generate dynamic font texture........
« Reply #3 on: July 23, 2014, 02:18:03 PM »
Thanks, that did the job perfectly