Search Unity

TextMesh Pro About loading at run time for TextMesh Pro.

Discussion in 'UGUI & TextMesh Pro' started by Toshiyuki_M, Apr 25, 2019.

  1. Toshiyuki_M

    Toshiyuki_M

    Joined:
    Apr 25, 2019
    Posts:
    2
    Hi,
    I am Japanese game developer, and have many thinking about TextMesh Pro these days.

    I saw the article what TextMesh Pro could not manage the memory at run time. However my app need to release for oversea, so TextMesh Pro has to show different languages.
    I am guessing if the memory has all atlas data, the performance will be bad. So my goal is to make the loading system at run time.

    -----------------------------
    What I did is...

    One of TextMesh Pro features "Extract Atlas". If I use it, I can get Atlas images in FontAsset.
    The image has no relation of FontAsset, so no loading on play. And also easily to make asset bundle.

    I made instance copy of FontAtlas and the empty atlas data. Then I could got the FontAsset what has only the mapping info and property.
    Then made a class to be inherited TextMesh Pro, and I confirmed Extract Atlas could be loaded/unloaded and this is onto memory when the call.

    The code I made is to analyze characters one by one and loading when needed. Such as, if you need "(Japanese Text) (Chinese Text)", you can get "(Japanese Text)" from FontAsset in Japanese and "(Chinese Text)" from FontAsset by Extract Atlas.

    -----------------------------
    What I want to know...

    1. This way to use Extract Atla is ok? I am not really confident to use this because there are quite small the info.
    2. Is there the alternative way?
    3. Should I use Text component? I think it cannot be used SDF rendering, and more increase SetPass Calls(Draw Calls).
    4. In the nealy future, TextMesh Pro will has loading at run time?

    Thank you for reading, and if you have any idea, please let me know/try.
     
    Last edited: Apr 25, 2019
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The latest release of TextMesh Pro version 1.4.0 (latest is now 1.4.1-preview.1) now supports Dynamic SDF where it is now possible to populate atlas textures at runtime.

    I suggest you test version 1.4.1-preview.1 as this release should provide you with the functionality you seek.
     
  3. Toshiyuki_M

    Toshiyuki_M

    Joined:
    Apr 25, 2019
    Posts:
    2
    Ohh, I forgot to mension my TextMesh Pro version, actually it was 1.3.0.
    Thank you so much for your advice! I am going to try your suggestion now.