Author Topic: Lag on Ipad due to font.cachefontfortext  (Read 3526 times)

JACLEMGO

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Lag on Ipad due to font.cachefontfortext
« on: June 26, 2014, 02:48:47 AM »
Im using the latest version on NGUI for an educational game, so the text on labels changes a lot, I sometimes get a font.cachefontfortext in the profiler of more than a sec, which causes a lag on the ipad2.

Im using a dynamic font

How can I solve this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 316
  • -Receive: 1149
  • Posts: 22,027
  • Toronto, Canada
    • View Profile
Re: Lag on Ipad due to font.cachefontfortext
« Reply #1 on: June 26, 2014, 11:13:52 AM »
Just one "for sure" way: don't use dynamic fonts. There are many issues with dynamic fonts which led to me quietly abandoning feature developments related to using dynamic fonts.

If you absolutely have to use dynamic fonts, be sure to not use the "crisp" setting on labels, and stick to labels using the same size fonts. Ie: if you have 10 labels and they all use a different font size, then you are effectively having to cram 10 times more data into the font's textures.

JACLEMGO

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: Lag on Ipad due to font.cachefontfortext
« Reply #2 on: July 01, 2014, 01:20:08 PM »
I converted the font to NGUI font, and that solved the issue.
Why is there an option to use Unity font also?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 316
  • -Receive: 1149
  • Posts: 22,027
  • Toronto, Canada
    • View Profile
Re: Lag on Ipad due to font.cachefontfortext
« Reply #3 on: July 02, 2014, 05:07:36 AM »
In hopes that Unity will fix the issues with dynamic fonts some day. Perhaps in 4.6...