9

I wonder how whatsapp gives support for that. I could use emojis on iPhone because it is natively supported. I'm not developing for bb neither android but I need to help a coder with this stuff.

The bb guy told me that he can add a font as a project resource (ttf), but since emojis are colored graphics, I'm not sure if i can create a ttf. I do not know anything about fonts either.

As you can see, my unknowledge is huge on this. I just need some tips that point me to the right way to research.

Thanks!

Maksym Gontar
  • 22,765
  • 10
  • 78
  • 114
Jorge
  • 2,056
  • 1
  • 16
  • 23
  • For the non japan peeps: Emoji (絵文字?) is the Japanese term for the picture characters or emoticons used in Japanese wireless messages and webpages. – Mark Mooibroek Apr 18 '11 at 05:06
  • Hey you guys! Reputation means money here :) I'm not working on this today, but I will take look on your answers in the next days. Thanks! – Jorge Apr 18 '11 at 05:56
  • See alternative answer for Blackberry http://stackoverflow.com/questions/7268276/blackberry-emoticons-in-chat-application/7861476#7861476 – Maksym Gontar Oct 22 '11 at 18:13

3 Answers3

17

On Android you can make a BitMap font with the tutorial i found here. Then you can embed all your Emoji into that font.

For making this on the BlackBerry you can use the FontFamily class.
Here is a tutorial that explains how this works.

Have fun! :-)

Mark Mooibroek
  • 7,636
  • 3
  • 32
  • 53
  • I had no time to see any post here since i was working on another stuff. I'm really interested on this but I will take a look on it later. I will accept your answer because people voted you. I will be back some day on this question with my conclusions. Thanks to all for your time. – Jorge Apr 24 '11 at 21:23
  • Could someone confirm if this approach works? Maybe someone who created an application using this idea? I'm interested for a Blackberry app. – Corneliu Dascălu Jun 01 '11 at 05:06
  • I am doing something similar HERE!!! http://stackoverflow.com/questions/16768930/implementations-of-emoji-emoticon-view-keyboard-layouts – Etienne Lawlor May 27 '13 at 08:14
5

From my experience most emoticons (emoji) do not use a font, but are rather bitmap graphics (e.g. emoticons in the default Android text editor). There are several downsides to using a font:

  • Suppose you made the characters a, b, c, d etc into emoticons - the user would then be unable to read/send messages with those characters in without them turning to emoticons.
  • Fonts are generally quite large as they contain a lot of information for displaying the text at different sizes/styles

Using bitmap graphics will allow you to easily use the same emoticons across a wide range of devices, whilst using standard device fonts the text around the emoticons.

You will have to parse the string that you are displaying, find the emoticons, and replace them with images.

On Android for instance you would accomplish this with:

  1. Search the string for all emoticon occurences (regex can do this easily enough)
  2. Replace all emoticons with the string <img src="emoticon.png" /> (althugh change emoticon.png based on the type of emoticon)
  3. Convert the String to HTML with String myHtmlString = Html.fromHtml(myEmoticonString, myImageGetter, null);
  4. Display the string in a TextView myTextView.setText(myHtmlString)

In step 3 myImageGetter needs to be an instance of Html.ImageGetter which returns a graphic (drawable) based on the src attribute of the images in the string (ie it converts a string file name to an actual graphic)

The steps on other platforms would be different but you should be able to use the same basic method (parse string, replace emoticons with images).

Joseph Earl
  • 23,351
  • 11
  • 76
  • 89
  • Thanks for your view and answer. I want to made the Emoji like custom Keyboard instead of my Android Default keyboard. So how to do it ? Please see question here:http://stackoverflow.com/questions/9356663/android-custom-emoji-keyboard-for-my-own-graphics – Shreyash Mahajan Feb 20 '12 at 07:34
0

Let me tell what I know, I dont know emoji, but googling it had me thinking it is a set of emoticons, primarily Japanese in origin. If that is true I would like to point out that it is common to create custom fonts using a font file (shown here). And in that font file you should be able to embed these emoticons and use them.

The link I provided above, is for J2ME, but the logic and design should be similar. Hope this helps.

omermuhammed
  • 7,365
  • 4
  • 27
  • 40