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 TextMeshPro, £ symbol + character spacing

Discussion in 'UGUI & TextMesh Pro' started by andyz, Mar 19, 2019.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,246
    [minor] The basic ASCII set (not extended) does not include a £ symbol - which is right... but could you possibly add a drop down for font generation that includes the '£' symbol in addition for the sake of your UK users so I don't have to list out a custom set?! ;)
    To be honest I would just like to add a list of 'extra' characters on top of selected ascii/char set but not sure I can do that

    The character spacing (under spacing options of UGUI script) meanwhile is a bit confusing - not sure what scale the number is in but seems to relate to size of text in the font texture so if you regenerate the font with more or less characters all your spaced out text breaks/changes because the space enlarges or shrinks.
    Would it not be better being a constant canvas pixel value?

    (also the ? button on the UGUI text script inspector goes to dead link - 1.3.0)
     
    Last edited: Mar 19, 2019
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    That may depend on your current System.Locale settings, but I'm not sure.

    That's true about most of the per-font textmesh settings, and it can't really be done any other way without imperfections. I would challenge you to try to come up with a data format that would allow minor tweaks to persist if a font texture is regenerated with it's characters in different positions. Keep in mind, you would need to detect new character rects, and old adjustments must work with the new rects, even if they are a different size/shape than before.

    Also keep in mind you can generate multiple font textures out of one font. So maybe when you run into an issue that requires a new font texture, you could create a new one instead of re-generating the existing one.

    It is a constant pixel value, but for the font texture, not the canvas. The font asset has no knowledge of what canvases or 3D scenes it'll end up in.
     
  3. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Using version 1.3.0 of TMP, you can create a font asset that includes extended ASCII and save it. Then select the font asset and use the Update Atlas Texture which should open the Font Asset Creator with Unicode Range (Hex) with the current ranges listed where you can add any additional unicode ranges or individual unicodes or switch to Custom Characters and type the additional characters in the list.

    Character Spacing is affected by the Sampling Point Size which I agree can be confusing so I'll take a look at this again. The spacing should scale with the point size but I agree should not be affected by sampling point size.

    Thanks for reporting this. Documentation for TMP is being worked on and this icon / link I guess should be updated.
     
    MSplitz-PsychoK and andyz like this.