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 <mark> tag not work on custom fonts.

Discussion in 'UGUI & TextMesh Pro' started by sayginkarahan, Sep 15, 2022.

  1. sayginkarahan

    sayginkarahan

    Joined:
    Jan 23, 2015
    Posts:
    49
    Hi, I create an Arial font asset using TextMeshPro Font Asset Creator. But the marked effect disappears if I change the text font "LiberationSans SDF" to "My Custom Arial Font". What should I do to enable marking for my font asset, thank you.

    x1.png

    x2.png


    002.png

    003.png

    004.png
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The <mark>, <u> and <s> tags require the Underline character and glyph be present in the font asset. Does your custom font asset include the underline character?
     
  3. sayginkarahan

    sayginkarahan

    Joined:
    Jan 23, 2015
    Posts:
    49
    Sure, I'm just adding windows default Arial font into TextMeshPro Font Asset Creator. It supports underlining, I reproduce the case in one minute on the video.

     
    Last edited: Sep 16, 2022
  4. sayginkarahan

    sayginkarahan

    Joined:
    Jan 23, 2015
    Posts:
    49
    @Stephan_B Do you know what should I do? Could you help me, please?
     
  5. sayginkarahan

    sayginkarahan

    Joined:
    Jan 23, 2015
    Posts:
    49
  6. sayginkarahan

    sayginkarahan

    Joined:
    Jan 23, 2015
    Posts:
    49
    I need some support here...
     
  7. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Thank you for providing the video above.

    The <mark> should be working. Having said that, let's do a different route to resolve your issue.

    First, I noticed that you are creating a font asset using the font asset creator. This is fine but you do end up with an Atlas size of 4096 x 4096 which is very large. Furthermore, the sampling point size is pretty big with large padding but still with a smaller than 10% ratio.

    My suggestion to resolve this issue, would be to create and using a Dynamic Font Asset using this Arial font file. You can easily create Dynamic Font Assets, by selecting the font file and then using the relevant context menu as seen below.

    upload_2022-9-22_0-37-46.png

    Once the Dynamic Font Asset has been created, please enable Clear Dynamic Data on Build and Multi Atlas Texture on it. Don't change any of the other settings yet. At this stage we are just trying to resolve your issue while at the same time getting you to a more efficient memory wise setup.

    Please consider watching the following two videos which cover dynamic font assets and other important stuff.