Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Feature Request Add SetCharArray-like support for ReadOnlySpan<char>

Discussion in 'UGUI & TextMesh Pro' started by Nanmu, Feb 24, 2023.

  1. Nanmu

    Nanmu

    Joined:
    Aug 20, 2018
    Posts:
    4
    There was a similar request for Span support about a year ago that was marked as resolved, but there hasn't been any Span/ReadOnlySpan support added to TMP yet. Now that 2021 LTS is just about to become the oldest supported version it would be great to add support to TMP_Text for setting text via ReadOnlySpan<char>. The usage could be identical to how SetCharArray is currently used. The only difference is the function would take a ReadOnlySpan<char> rather than a char[]. It's unfortunate to have to embed the package to support minor additions like this.
     
  2. Nanmu

    Nanmu

    Joined:
    Aug 20, 2018
    Posts:
    4
    Is this forum still the appropriate place to make feature requests? Adding support for this is trivial if you're willing to embed TMP in your project, but it would be significantly more convenient for TMP to support it by default.