不一致的Unicode表情符号字形/符号 [英] Inconsistent Unicode Emoji Glyphs/Symbols

查看:704
本文介绍了不一致的Unicode表情符号字形/符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在Apple和iOS的产品中使用Unicode符号进行占星术。我得到了不一致的结果,如下所示:

I've been trying to make use of the Unicode symbols for astrology in products for both Apple and iOS. I'm getting inconsistent results, as shown here:

其中大部分按照我喜欢的方式出现,但由于某种原因,金牛座的符号出现在第一行的一个方向上跟随着月亮,以及一种截然不同的方式,使用类似表情符号的紫色按钮,当它跟随火星时。这些结果对于不同的符号和Apple硬件是一致的;这是我的手机屏幕截图显示同样的问题与其他一些迹象 - 天蝎座出来没事,但天秤座和巨蟹座是按钮。

Most of these are coming out as I like, but for some reason the Taurus symbol is appearing one way on the first line, following the Moon, and a very different way, with the Emoji-like purple button, when it follows Mars. These results are consistent for different symbols and across Apple hardware; here's a screen capture from my phone showing the same problem with some other signs - Scorpio comes out all right, but Libra and Cancer are buttons.

字符串非常简单;第一张图片中的月亮金牛座为月亮的 \ u263D ,金牛座的 \ u2649 ,基本上组装为 [NSString stringWithFormat:@%@%@,@\ u263D,@\ u2649] 。 火星金牛座图像是相同的,只有火星的 \ u2642 。字符串格式在OSX表的不同单元格和iOS AttributedString中是相同的。

The strings are extremely straightforward; "Moon Taurus" in the first image is \u263D for Moon, \u2649 for Taurus, basically assembled as [NSString stringWithFormat:@"%@%@", @"\u263D", @"\u2649"]. The "Mars Taurus" image is the same, only with \u2642 for Mars. The string formatting is identical in the different cells of the OSX table, and in the iOS AttributedString.

任何想法是什么使这些符号有时出现一种方式,另一种方式其他时间?

Any idea what makes these symbols appear one way sometimes, and another way other times?

推荐答案

Unicode使用变体序列在列出的某些代码点的不同渲染之间进行选择 StandardsVariants.txt 文件。在您的情况下,占星符号具有文本样式和表情符号样式变体,可通过 U + FEOE (文本样式)或<$ c $选择c> U + FE0F (表情符号样式)代码点后面:

Unicode uses variation sequences to select between different renderings for certain code points—listed in the StandardizedVariants.txt file. In your case, the astrological symbols have both "text style" and "emoji style" variants that are selected between by a U+FEOE (text style) or U+FE0F (emoji style) following the code point:


U +2650 U + FE0E :♐︎

U +2650 U + FE0F :♐️

请注意,变体选择器的正确解释取决于应用程序/框架和正在使用的字体的支持。在Chrome(42)上,我的上述示例之间似乎没有任何区别,但在Safari(8)上它们是截然不同的。

Note that correct interpretation of the variation selector depends on support from both the application/framework and the fonts being used. On Chrome (42) there doesn't appear to be any difference between my examples above, but on Safari (8) they are distinct.

这篇关于不一致的Unicode表情符号字形/符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆