Search Unity

TextMesh Pro Stripping out modified emoji

Discussion in 'UGUI & TextMesh Pro' started by sjml, Feb 10, 2019.

  1. sjml

    sjml

    Joined:
    Feb 17, 2017
    Posts:
    2
    I know the work is ongoing to properly support multi-codepoint emoji and modifiers, but in the meanwhile, I'm trying to figure out how I could take a standard UTF-8 encoded string and strip out the modifiers so that it only shows base emoji — basically, if a user enters "[white thumbs up]" I'd rather just show "[yellow thumbs up]" than "[yellow thumbs up][snowboarder]", which is how it currently renders.

    Given the many different codepoint ranges where emoji live in Unicode, plus the different ways modifiers get applied, I've had trouble figuring out how best to reduce a sequence of codepoints to an unproblematic single glyph. Has anyone else tried to do this, or know of a library that might make it more doable? I was briefly toying around with https://github.com/neosmart/unicode.net, but couldn't quite get it to parse the data in a way that was useful.

    Thoughts or advice appreciated!