views:

354

answers:

3

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.

+4  A: 

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.

davebug
A: 

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.

Milan Babuškov
That could be made to work in the first example instance, but wouldn't really solve the problem...
Aaron H.
+6  A: 
Josh
This is a good answer, and pretty close to what I'm doing currently in example two, with the exception of adding a character to the font. That may improve the process a little. The one remaining problem is that this the process is very slow and must be heavily optimized...
Aaron H.