Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro How to create TMP_FontAsset with new font image and data of glyphs rect?

Discussion in 'UGUI & TextMesh Pro' started by Ksushqa, Dec 10, 2019.

  1. Ksushqa

    Ksushqa

    Joined:
    Jun 14, 2017
    Posts:
    4
    Hi everyone!

    I'm stuck with a problem of TMP_FontAsset generation.

    I have the image with all font symbols that I need. Also I have the data of every glyph rect and other data for glyph table. I tried to create new TMP_FontAsset by right mouse click in Project window. Then: Create -> TextMeshPro -> Font Asset. But nothing's happend. No new asset in the project. Hmm, okay.

    Then I tried to refill some existing FontAsset by new data. I can fill it correctly by my glyph data from the code. But I cannot understand how to correctly set up my Image which should be taken the data from. I mean that previous settings are used there and my current texture doesn't show correct preview in character table of FontAsset. There are many "empty" preview. And when I tried to find where is my symbols by changing glyph rect fields in the Inspector I saw that this image is too small. How can I make It bigger? Also It looks like the image has wrong center but I'm not shure of it.

    I don't event ask how to create new FontAsset from code. But I want to understand what I should do to set up my image and, for example, first glyph of my font. What kind of settings in FontAsset are required to fill?

    Maybe, I don't understand some rules how to use new image. It's png file with "sprite" texture type.
     
    Last edited: Dec 10, 2019