akarpovskii/tuile

Composite emojis not displayed correctly

akarpovskii opened this issue ยท 0 comments

Steps to reproduce and observed behavior

Some emojis like ๐Ÿ‘๐Ÿป = ๐Ÿ‘ ๐Ÿป are not properly handled by some terminals resulting in emojis losing their skin tone modificator.

Expected behavior

Emojis displayed correctly

Environment

E.g. Terminal.app

Additional context

#9 introduced initial unicode support by splitting unicode strings into graphemes and printing each grapheme in its own cell.
Some (most?) of the terminals out there do not support grapheme segmentation, and instead print each code point in it's own cell.

This issue and a possible solution was described here. That is, Tuile needs to be able to detect if grapheme segmentation is supported by the terminal by querying if it supports mode 2027. If mode 2027 is not supported, Tuile needs to print unicode by code points.