Search Unity

  1. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  2. Unity 2017.2 is now released.
    Dismiss Notice
  3. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  6. Unity 2017.3 beta is now available for download.
    Dismiss Notice

TextMesh Pro TMP and custom font

Discussion in 'Unity UI & TextMesh Pro' started by Brathnann, Apr 4, 2017.

  1. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    2,635
    I know TMP let's you customize a font and all that, which is great, but we need to try and get a new build out a bit quicker than messing with trying to get things the way we want in TMP currently. We have a custom font that was designed in Photoshop and we used Unity's custom font feature to create our own custom font from it. We were using a small script to curve the text, but the script is giving errors in 5.6, so we wanted to use TMP's curve text feature. Is there a way to use our custom font that we already have set up with TMP?

    Thanks!
     
  2. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    It is possible but there is not automated way of doing it. Someone would have to create a script to do it which would not be difficult.

    Here is sort of the manual steps to do it which should give you a good idea of how a script could be implemented.

    1. Using the Font Asset Creator, create a font asset using your font and make sure the atlas size and padding value kind of matches what we used in your custom font atlas. Also try to add / include the same characters. Don't worry too much about each character as you can add / remove glyph from the glyph table manually.

    2. Import your new font atlas texture and with the Inspector panel set to debug mode on the font asset, replace the existing atlas by yours. Then select the embedded material and assign your texture to it.

    3. Then switch back to normal mode in the Inspector (ie. not debug mode) then you will need to manually edit each of the glyphs in the Glyph table to match the data with your .fnt data for your custom font. This process will be painful and this is where a script that would automatically convert the data from the .fnt to this required data format be handy :)

    This should work. I am in Iceland right now with limited access but I'll be checking in whenever possible. Worst case, I will be back in the US over the weekend and can help you / create that script when I return. If you need my assistance with this, please provide me (via email) with your custom font and the .fnt file.

    P.S. I used the wrong account on this post ... oops/.
     
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    2,635
    Thank you. Will take a look into this and see what we can do.
     
  4. indieDoroid

    indieDoroid

    Joined:
    Jan 25, 2016
    Posts:
    40
    is it possible to use Foreign characters like Simplified Chinese or Japanese with TextMeshPro? When I try using the asset creator tool, TextMeshPro only recognizes the English characters.
     
  5. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    578
    It is absolutely possible.

    You have to make sure the font you are trying to use does contain characters for those given languages.

    Also make sure the you are familiar with the various options in the Font Asset Creator to select the characters for those given languages. Please see the following video which covers all these options

     
    brennan_agm likes this.
  6. Tarrag

    Tarrag

    Joined:
    Nov 7, 2016
    Posts:
    10
    Hi everyone

    I created with TextMesh Pro a font atlas and saved this font but I need to add another character. When opening Font Asset Creator, I cannot choose this customized font I created, therefore I would have to create the Atlas again but I don't remember the settings I originally used.

    Is there a way to edit the Font Settings I used in Asset Creator, or even better a way to add another character to this atlas existing font? Bear in mind Asset Creator does not let me choose the TMP font I generated in Asset Creator, else it'd be straight forward.

    Thank you, Sergio
     
  7. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    578
    The potential key settings to retain would be Atlas size, Sampling Point Size and Padding value and of course what characters were contained in the previous font asset.

    The Sampling Point Size, Padding and Atlas size are listed in the font asset inspector. In terms of the characters previously contained in the font asset, when selecting Character Set options in the font asset creator like custom characters, you can specify another font asset (or the one you are trying to update) and it will pull the characters contained in that asset. See the following video about this.

    Lastly, you can save over the original font asset and this will retain its meta data / GUID and assignments. It will also update all material presets that were using this font asset's atlas texture (provided you follow the naming convention on material presets which is to retain the name of the font in the material preset name like "Arial SDF - something".