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

查看:42
本文介绍了不一致的 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.

字符串非常简单;第一张图中的Moon Taurus"是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 使用 变体序列 为某些代码点在不同的呈现之间进行选择——列在 StandardizedVariants.txt 文件.在您的情况下,占星符号既有文字样式",也有文字样式"和文字样式".和表情符号风格"通过代码点后面的 U+FEOE(文本样式)或 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天全站免登陆