表情符号的正确显示方式是什么?
在您自己的应用程序中。
[编辑]
好吧,所以我完全同意——比你知道的还要多——毫不含糊地认为图形表情符号是令人厌恶的。 但! 当项目所有者告诉我我们必须支持图形表情符号时,这对我没有帮助。
[/edit]
这个问题比最初看起来更复杂,特别是当你考虑到编辑、自动换行、可变宽度时字体和颜色表情符号。
所以我的问题实际上是针对那些做过这件事的人,你们是否想出了一种令人满意的方式来呈现表情符号,而不仅仅是一次大规模的黑客攻击?
开始讨论:
在两个实现中,我已经尝试了以下方法。
在 3D 应用程序中,文本行渲染为“纹理”; 我用图像替换了表情符号字符串,匹配文本渲染的类型,因此表情符号变成了文本的另一个元素。
本质上,文本渲染引擎必须进行最深层次的修改。 这产生了良好的结果,但非常耗时,并且很难正确(或者至少对我来说无论如何;P)
在第二种方法(使用不同的语言和平台)中,我决定尝试更高级别的“假”通过用单个字符替换表情符号字符串并在替换的字符上绘制情感。 这当然有很多限制,但优点是实施起来相当快,并且无需付出过多的努力就可以达到相当稳定的状态。
In your own application that is.
[edit]
Alright, so I agree completely -- more than you know -- without equivocation that graphical emoticons are an abomination.
But! That doesn't help me when the project owners tell me that we must support graphical emoticons.
[/edit]
The problem more complex than it would initially seem, especially when you take into account editing, word wrapping, variable width fonts, and color emoticons.
So my question is really to people who have done this, have you come up with a satisfactory way of rendering emoticons that isn't just one massive hack?
To start the discussion:
In two implementations I've tried the following approaches.
In a 3D application where lines of text where rendered to "textures"; I replaced emoticon strings with images, matching the type of the text renders, so the emoticon becomes just another element of the text.
Essentially the text rendering engine had to be modified at the deepest levels. This produces good results, but is very time consuming, and very hard to get right (Or at least for me anyway ;P)
In the second approach (With a different language and platform) I decided to try a higher-level "fake" by replacing emoticon strings with a single character and drawing emotions over the replaced character. This of course has lots of limitations, but has the benefit of being fairly fast to implement, and it's possible to reach a reasonably stable state without an excess of effort.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你的新字体。
strings into the character set of
your new font.
建议您考虑不转换表情符号是一个可以接受的答案吗? 文本表情符号的全部要点是它们可以以文本形式被识别。
[编辑]请不要让这个意见/建议阻止任何人帮助回答这个问题。 有时你无法与客户对抗,尽管可能值得多尝试几次。
Is it an acceptable answer to suggest you should consider not converting emoticons? The entire point of textual emoticons is that they're recognizable...in text form.
[edit] Please don't let this opinion/suggestion dissuade anyone from helping answer this question. Sometimes you can't fight the clients, though it may be worth a couple more attempts.
这里有一个想法:不要以任何方式转换它们,而是旋转 90 度。
例如,您可以渲染表情符号的图像,然后将该图像顺时针旋转 90 度并显示。
Here's an idea: don't convert them in any way, but rotate by 90 degrees.
For example, you can render the image of the emoticon and then rotate that image 90 degrees clockwise and display it.