如何显示彩色表情符号 [英] How to display a colored emoji
问题描述
我的代码:
let myemoji = "\u{2049}"
let another = "\u{2757}"
游乐场结果:
Unicode U + 2049不会产生像⁉️这样的红色表情符号。
是否需要为此颜色添加特定的颜色?
The Unicode U+2049 does not produce a red colored emoji like this ⁉️. Is there anything specific to be added for this color?
推荐答案
某些字符可以作为文本显示。或作为表情符号,以及
Unicode变量选择器可用于控制演示。
示例:
Some characters can be displayed "as text" or "as emoji", and a "Unicode VARIATION SELECTOR" can be used to control the presentation. Example:
print("text presentation: \u{2049} \u{25B6}")
print("emoji presentation: \u{2049}\u{FE0F} \u{25B6}\u{FE0F}")
结果:
更多信息,请参见 1.4.3表情符号和文本表示顺序:
ED-8。文本表示选择器—字符U + FE0E VARIATION SELECTOR-15,用于请求表情符号字符的文本表示。 (在本规范的先前版本中也称为文本变体选择器。)
ED-8. text presentation selector — The character U+FE0E VARIATION SELECTOR-15, used to request a text presentation for an emoji character. (Also known as text variation selector in prior versions of this specification.)
ED-9。表情符号表示选择器—字符U + FE0F VARIATION SELECTOR-16,用于请求表情符号字符的表情符号表示。 (在本规范的先前版本中也称为表情符号变体选择器。)
ED-9. emoji presentation selector — The character U+FE0F VARIATION SELECTOR-16, used to request an emoji presentation for an emoji character. (Also known as emoji variation selector in prior versions of this specification.)
或变量选择器16 :
一个不可见的代码点,用于指定应显示前面的字符与表情符号演示。仅当前面的字符默认为文本表示时才需要。
An invisible codepoint which specifies that the preceding character should be displayed with emoji presentation. Only required if the preceding character defaults to text presentation.
这篇关于如何显示彩色表情符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!