Search Unity

TextMesh Pro How to generate a Font Asset from a bitmap font

Discussion in 'UGUI & TextMesh Pro' started by snarlynarwhal, Jan 11, 2021.

  1. snarlynarwhal

    snarlynarwhal

    Joined:
    Jan 16, 2014
    Posts:
    30
    Hello,
    I have a custom bitmap font that I want to use. I can't figure out how to generate a font asset from a bitmap font. It seems that the type Font only accepts .ttf and .otf fonts. Does anyone know how I can accomplish this?
    Percy
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What format / file type is this bitmap font using?
     
  3. snarlynarwhal

    snarlynarwhal

    Joined:
    Jan 16, 2014
    Posts:
    30
    I just have a texture at the moment. I did start looking into .fnt and .fon files, but stopped when I found the "Custom font" section of the Font docs. It describes how to make a custom font. However, it seems to only work with Unity Text. I think it'd be nice if it could work with TextMeshPro as well. Also, defining the character rects is very tedious. I plan to write a script to automatically set those tomorrow. It'd be nice to have a tool to automatically define them based on settings (kind of like the slice tool in the sprite editor).
     
  4. wickedpopular

    wickedpopular

    Joined:
    Oct 29, 2016
    Posts:
    33
    Hello! Were you able to find a solution to this?
     
  5. snarlynarwhal

    snarlynarwhal

    Joined:
    Jan 16, 2014
    Posts:
    30
    I gave up on trying to get TMP to work with bitmap fonts :/
     
  6. wickedpopular

    wickedpopular

    Joined:
    Oct 29, 2016
    Posts:
    33
  7. snarlynarwhal

    snarlynarwhal

    Joined:
    Jan 16, 2014
    Posts:
    30
    I gave up on bitmap fonts tbh, but if I want to give it another go sometime, I'll revisit that thread. Thanks for sharing!
     
    wickedpopular likes this.
  8. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    See my reply to the above referenced thread.