Search Unity

Importing True Type Font from external source at runtime

Discussion in 'Scripting' started by hima, Feb 4, 2012.

  1. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    Is it possible to import a TTF file into Unity at runtime? Can we load the font with WWW just like images and audio files?
     
    DTo likes this.
  2. foxter888

    foxter888

    Joined:
    May 3, 2010
    Posts:
    530
    have you tried using the resources class? from the unity scripting reference? like Resources.Load? that means that you need a folder called Resources too in your unity project by the way
     
  3. hima

    hima

    Joined:
    Oct 1, 2010
    Posts:
    183
    Yes, but I'm talking about external source. As in, the game is already compile to .exe or .app. Is there anyway we can import or load a font file when our game is in that state? Maybe from a Font folder sitting next to the executable. For textures and audios, there's WWW class that allow you to do that.

    Maybe I should try WWW class with font file and see the result. Though if anybody has tried this, it would be nice to hear the experience!
     
    DTo likes this.
  4. Cyber-Dog

    Cyber-Dog

    Joined:
    Sep 12, 2018
    Posts:
    352
    Hey Man,

    Did you ever find a solution to this?
    Im having the same issue.
     
  5. doctorpangloss

    doctorpangloss

    Joined:
    Feb 20, 2013
    Posts:
    270
    You can distribute fonts via an asset bundle, if that will do for you. Otherwise, no, Unity can't out-of-the-box prepare a True Type font file at runtime for use in e.g. UGUI.