def _load_unicode_emoji_variants():
    """Parse StandardizedVariants.txt and initialize a set of characters
    that have a defined emoji variant presentation.  All such characters
    also have a text variant presentation so a single set works for both."""

    global _emoji_variants, _emoji_variants_proposed
    if _emoji_variants:
        return

    emoji_variants = set()
    # prior to Unicode 11 emoji variants were part of the standard data.
    # as of Unicode 11 however they're only in a separate emoji data file.
    line_re = re.compile(r"([0-9A-F]{4,6})\s+FE0F\s*;\s*emoji style\s*;")
    with open_unicode_data_file("emoji-variation-sequences.txt") as f:
        for line in f:
            m = line_re.match(line)
            if m:
                emoji_variants.add(int(m.group(1), 16))

    _emoji_variants = frozenset(emoji_variants)

    try:
        read = 0
        skipped = 0
        with open_unicode_data_file("proposed-variants.txt") as f:
            for line in f:
                m = line_re.match(line)
                if m:
                    read += 1
                    cp = int(m.group(1), 16)
                    if cp in emoji_variants:
                        skipped += 1
                    else:
                        emoji_variants.add(cp)

        print(
            "skipped %s %d proposed variants"
            % ("all of" if skipped == read else skipped, read)
        )
    except IOError as e:
        if e.errno != 2:
            raise

    _emoji_variants_proposed = frozenset(emoji_variants)