Search Unity

Creating a Custom Font

Discussion in 'Immediate Mode GUI (IMGUI)' started by toddworld, Feb 5, 2011.

  1. toddworld

    toddworld

    Joined:
    Dec 11, 2010
    Posts:
    14
    Ok, I've searched all over and this can't be that big a request. How do you make a custom font (most likely using a texture) in Unity. I'm not talking about importing a TTF. I mean I want a font with a colored outline, a gradient from top to bottom on each character, etc. A custom font.

    There are things in Unity that LOOK like they would be able to do this, but (like "create custom font"). But I create a texture (I just need characters 0-9 for score bubbles), use the "create custom font" but it never quite works.

    Anyone have any suggestions I'd be very grateful.

    Thanks,
    Todd
     
  2. TheCasual

    TheCasual

    Joined:
    Sep 30, 2010
    Posts:
    1,286
    Fonts are a completely different kind of asset than you are assuming., A font is completely system dependant. Before Unity can use that font, windows (your system, not everyone uses a pc) needs to be able to use it, but to create them, you need to find a tool that will make fonts for you. Theres ways to hand etch the fonts and scan them in etc... theres also a few tools that allow you to just create a font within the editor and save it. I have also noticed almost all these tools cost some money.
     
  3. toddworld

    toddworld

    Joined:
    Dec 11, 2010
    Posts:
    14
    It "appears" Unity has the ability to handle fonts in two ways. One as a "dynamic" font which uses the actual font data you mention (for variable sizing etc.), in addition to that they can be handled as (the labels says) "ASCII" fonts. In which case, it "appears" that the font is imported and converted to a texture (technically it looks like it's just using it as an alpha of the material it gets assigned to).

    I know those are a lot of 'appears'...but from a UI standpoint that's what it looks like. I've seen a lot of posts on the forums of people asking how to export that texture that gets generated...which would probably work, but unfortunately I haven't seen anyone's reply that actually tells how to do it.

    There are hints all over Unity's UI and menus that this shouldn't be a hard thing to do...but I'll be darned if I have found a way yet.

    (definitely posting a tutorial if I ever do since it seems to be a pretty common request.)

    Thanks,
    Todd
     
  4. toddworld

    toddworld

    Joined:
    Dec 11, 2010
    Posts:
    14
    So really? This is truly that difficult or impossible a thing to do in Unity?
     
  5. GameGuy

    GameGuy

    Joined:
    Apr 21, 2010
    Posts:
    36
    Nothing is impossible ;) ,
    but it depends on your level of knowlege how dificult something will be. If everything around here would be new to me, the last thing I would do is waisting time with a Custom Font(Only my 2cents).

    All Over, Really? Have you tryed Google too?

    http://www.myfirstfont.com/ <-- Really easy step by step Tut for fontcreation

    http://fontstruct.com/ <-- A Fontcreation Programm

    I hope this will help you :) !
     
    Last edited: Feb 13, 2011
  6. toddworld

    toddworld

    Joined:
    Dec 11, 2010
    Posts:
    14
    Thank you very much for the reply and advice. Fontstruct looked very interesting, may have to check it out sometime. I do have Fontographer (old school), if I needed to create a TTF or OTF.

    However, this is still approaching fonts as if they were 'fonts'. In Unity they'd be "dynamic fonts", as they refer to them. What I'm looking for (and there are user interface indicators that Unity supports it...but I just can't make it all come together), is a sprite sheet or character sheet font. The problem is with the 'dynamic fonts' you appear pretty (extremely) limited in appearance. You get, font size, color, and style (bold, italic...etc). The type character sheet I've created has a boarder around the font and a two color gradient from top to bottom. I don't see this being real possible with the 'dynamic' fonts.

    So, although I very much appreciate the suggestion, I believe I'm still searching for an answer. And at this point I'm really starting to wonder is this is just some huge limitation of Unity.

    Thanks,
    Todd
     
  7. zappapa

    zappapa

    Joined:
    Dec 12, 2010
    Posts:
    57
  8. davidsirmons

    davidsirmons

    Joined:
    Mar 16, 2014
    Posts:
    190
    Good Lord. That's unbelievable.
     
  9. irfanSamuel

    irfanSamuel

    Joined:
    May 14, 2013
    Posts:
    11
  10. VanKurt

    VanKurt

    Joined:
    Jun 1, 2013
    Posts:
    16
    I ran into the sample problem. Creating texts for score-popups, GUI etc. etc. is such a basic piece of functionality. But Unity offers nothing here. Of course you can buy a GUI framework like NGUI, but for me this was too expensive.

    I ended up creating all static text blocks in Gimp, and use them as sprites in the game. For dynamic score popups I created sprites for every cypher (0-9) which I instantiate in the correct order/positions during runtime.
    => That really sucks. It's a lot of work and the result is barely maintainable. Also localization is almost impossible

    I really hope that Unity 4.6 with the much anticipated new GUI system will offer a comprehensive solution to this problem.
    Adding support for Bitmap Fonts (e.g. created with bmGlyph) shouldn't be too hard...
     
  11. VanKurt

    VanKurt

    Joined:
    Jun 1, 2013
    Posts:
    16
    Just a short update on this topic. I was so unsatisfied withe current situation regarding bitmap fonts that I decided to create my own Unity plugin. The result was quite nice, so I decided not only to use it for my own games but also put it on the asset store.

    You can find the plugin here:Bitmap Font Pro. There's also a YouTube Video and some tutorials I wrote that show how to use it. Please let me know what you think :)
     
  12. katsuragi545

    katsuragi545

    Joined:
    Jun 25, 2014
    Posts:
    38
    If your special font is limited (e.g. you'll only be using numbers 0-50), then you can easily create each character/letter/number in a graphics program like Illustrator or Photoshop and bring them into Unity as separate images. You could then draw the image using OnGUI. I know it sounds like a bad workaround, so I would only recommend it if the text you'll need is limited. I used this method in a mobile game I made called Cannon Crew that only used numbers 0 - 120 and some title text.
     
  13. StabbyJoe1999

    StabbyJoe1999

    Joined:
    Dec 4, 2016
    Posts:
    3
    sisF and OzhHo like this.