Author Topic: How can I create a UIFont from a TTF file stored in memory?  (Read 3019 times)

appminis-mike

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
I've got a TTF file stored as a Byte array (we're pulling them down from a server so that we can add them remotely), and I want to create a UIFont from it. I'm not sure how to go about that. Can someone point me in the right direction?

Looking at the Font Maker, it looks like I need to make a Unity.Font and from that I can construct the UIFont. Is that the best way to go about it or is there an NGUI utility or something that I can leverage to make things simpler? I don't see a ready way to create a Unity.Font from TTF data, so I was hoping for a different route.

What's the best way to accomplish this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How can I create a UIFont from a TTF file stored in memory?
« Reply #1 on: July 11, 2013, 07:02:06 PM »
Can you even do that in Unity? I believe you can only use TTF fonts if you import them with the dynamic flag set to true.