Author Topic: Why is Font.CacheFontForText triggered if I only use bitmap font?  (Read 3421 times)

alexh0101

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 30
    • View Profile
I read the other threads related to Font.CacheFontForText().

They say it's related to dynamic font but I don't use any.
I am using only one font in a very big size and it's a bitmap font. I'm resizing this font to smaller sizes, depending on the needs.

I resized down that big font to about 10 different font sizes in the whole project. I also used 3 or 4 colour tints.

Why is Font.CacheFontForText() being called?
What should I do to avoid it?

Is it better to scale down the transform of a label instead changing the font size?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Why is Font.CacheFontForText triggered if I only use bitmap font?
« Reply #1 on: March 19, 2015, 06:36:07 AM »
Font.CacheFontForText is not used anywhere in NGUI, so I assume it's something in Unity 4.6+ related to creation of the dynamic font.

What you can do to avoid it? Don't use dynamic fonts. They have always been terribly broken in Unity. Stick to bitmap fonts. They're much faster too.

You say you don't use dynamic fonts, but if that was the case then you'd never see that.