Search Unity

TextMesh Pro Rich text bug: regular font is rendered behind <mark>, but custom font is rendered in front of it

Discussion in 'UGUI & TextMesh Pro' started by cxode, Nov 28, 2020.

  1. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    The draw order of the mark is inconsistent:

    upload_2020-11-28_7-19-13.png

    According to the docs, the intended behavior is that the mark is drawn on top of the text, so the other behavior is a bug.

    Personally, I would like to see both behaviors supported. Perhaps the former could use
    <overlay>
    , and the latter could use
    <underlay>
    .
     

    Attached Files:

  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I need to make some pretty important changes to properly handle sorting of the mark geometry as well as underline and strikethrough properly. For instance, underline and mark should almost always be behind the text whereas strikethrough on top.

    This is something I plan to address in the next preview release series.

    I do like the suggestion to add a new attribute to the mark tag which would look something like <mark color=#FFFF0080 padding="0, 0, 0, 0" sorting=0> ... where the value for sorting would be 0 or 1. I like the idea of using overlay and underlay but just not sure if sorting is the right name for this attribute. Open to suggestions.
     
    cxode likes this.
  3. cxode

    cxode

    Joined:
    Jun 7, 2017
    Posts:
    268
    I'd rather have separate tags than a new
    sorting
    attribute on the
    mark
    tag. I think that A) the number of attributes per tag should be minimized to keep things simple, and B) it is bad to use a number (0 or 1) to represent something that conceptually is not a number (over or under). If it must be a new tag, I'd much rather it be a boolean, something like
    behindText=true
    .

    Looking forward to the next preview releases!
     
  4. DavidRobichaud

    DavidRobichaud

    Joined:
    May 4, 2020
    Posts:
    1

    Is there any new development towards this feature?
     
  5. iileychen

    iileychen

    Joined:
    Oct 13, 2015
    Posts:
    110
    I need "mark is drawn on bottom of the text", how can I achieve?