Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,772,052 Members 40,423 Now Online
XDA Developers Android and Mobile Development Forum

[MOD] Apple Color Emoji system-wide for KitKat

Tip us?
 
angelsel
Old
(Last edited by angelsel; 2nd January 2014 at 08:36 AM.)
#1  
angelsel's Avatar
Member - OP
Thanks Meter 104
Posts: 31
Join Date: Jan 2011
Location: Singapore
Default [MOD] Apple Color Emoji system-wide for KitKat

Not sure if this has been done before, but here is my work.

Screenshots (warning: large)
 






You get my point. They work the same way KitKat's colour emojis work.

To install:
  1. Grab AppleColorEmoji.ttf and place it into /system/fonts/
  2. Set /system/fonts/AppleColorEmoji.ttf to have permissions 644 (rw-r--r--) and owner:group root:root.
  3. Modify /system/etc/fallback_fonts.xml like so:
    • Find
      Code:
          <family>
              <fileset>
                  <file>AndroidEmoji.ttf</file>
              </fileset>
          </family>
    • Above this block, add
      Code:
          <family>
              <fileset>
                  <file>AppleColorEmoji.ttf</file>
              </fileset>
          </family>
  4. Set /system/etc/fallback_fonts.xml to have permissions 644 (rw-r--r--) and owner:group root:root.
  5. Reboot.
(Thanks cclaxx for mentioning permissions!)

What I did:
  1. Asked someone (jakew02 on #cyanogenmod-dev) to help me grab Apple Color Emoji.ttf off an OS X 10.9 system.
  2. Used code available here to extract the PNG files from the TTF file's SBIX table.
  3. Used fonttools (ttx) to create an empty TTF file based on the original Apple Color Emoji.ttf and this template by Google
  4. Used this code by Google to add the extracted PNGs into the empty TTF file in CBDT/CBLC (the OpenType extension Google created) tables
  5. Took the resulting TTF file and threw it into /system/fonts/, modifying /system/etc/fallback_fonts.xml accordingly
And it works. This is unlikely to work on versions of Android pre-KitKat, unless support for CBDT/CBLC tables in font files is present (or backported from KitKat).

The font size and kerning (all the emojis are the same size!) doesn't seem all that great, but someone who knows fonts better can fix that using ttx. If anyone wishes to create a flashable zip for this, please do so.

Thank Google for deciding to implement colour emoji (and releasing their tools for creating those fonts too!) in KitKat, because they essentially did all the work.

I also used https://github.com/behdad/fonttools to decompile NotoColorEmoji.ttf to decide what resolution PNG files to use, but this isn't strictly required (the Apple TTF file has 160x160px files which can be used directly; I ended up resizing those files to 128x128px).

I can't for the life of me get XDA attachments to work.
The Following 87 Users Say Thank You to angelsel For This Useful Post: [ Click to Expand ]
 
yener90
Old
#2  
Senior Member
Thanks Meter 184
Posts: 409
Join Date: May 2010
Looked for it great

How did you do the fourth step?
im running windows and couldnt launch it.
I want to port Touchwiz Smileys to KitKat.
Those looking best
Phones:
Samsung Galaxy S4 -> CM 10.2
Sony Xperia Z -> CM 10.2
HTC Desire HD -> CM10.1
The Following User Says Thank You to yener90 For This Useful Post: [ Click to Expand ]
 
angelsel
Old
#3  
angelsel's Avatar
Member - OP
Thanks Meter 104
Posts: 31
Join Date: Jan 2011
Location: Singapore
Use Python 2.7.

I did this all on Linux, so I'm not sure if this can be done on Windows or not. But since all the tools are written in Python, I'd imagine that it can with minimal effort.
The Following 2 Users Say Thank You to angelsel For This Useful Post: [ Click to Expand ]
 
Jaggions
Old
#4  
Member
Thanks Meter 4
Posts: 56
Join Date: Nov 2013
Location: Bergamo

 
DONATE TO ME
Hi, I have just tried this on Android 4.4.2 (root, stock kernel & ROM) and it didn't work although I have followed your guide step-by-step. Any thoughts?
 
hhamzah49
Old
#5  
hhamzah49's Avatar
Senior Member
Thanks Meter 30
Posts: 234
Join Date: Mar 2013
Location: Den Haag
Also didnt work for me. Omni rom 4.4.2
 
Fusionalex
Old
#6  
Senior Member
Thanks Meter 34
Posts: 193
Join Date: May 2012
Location: Vienna
Sadly it also doesn't work for me! Please could you try fixing it? I love the idea!
The Following 2 Users Say Thank You to Fusionalex For This Useful Post: [ Click to Expand ]
 
cclaxx
Old
#7  
cclaxx's Avatar
Senior Member
Thanks Meter 48
Posts: 136
Join Date: Jul 2012
Location: milano
Quote:
Originally Posted by Jaggions View Post
Hi, I have just tried this on Android 4.4.2 (root, stock kernel & ROM) and it didn't work although I have followed your guide step-by-step. Any thoughts?
Quote:
Originally Posted by hhamzah49 View Post
Also didnt work for me. Omni rom 4.4.2
Quote:
Originally Posted by Fusionalex View Post
Sadly it also doesn't work for me! Please could you try fixing it? I love the idea!
guys maybe the problem are the permissions. you must set both files to rw-r-r otherwise it does not work.
The Following 2 Users Say Thank You to cclaxx For This Useful Post: [ Click to Expand ]
 
Jaggions
Old
#8  
Member
Thanks Meter 4
Posts: 56
Join Date: Nov 2013
Location: Bergamo

 
DONATE TO ME
Quote:
Originally Posted by cclaxx View Post
guys maybe the problem are the permissions. you must set both files to rw-r-r otherwise it does not work.
Oh, you're right, it worked! I feel so stupid :P Thank you!
 
hhamzah49
Old
#9  
hhamzah49's Avatar
Senior Member
Thanks Meter 30
Posts: 234
Join Date: Mar 2013
Location: Den Haag
Quote:
Originally Posted by cclaxx View Post
guys maybe the problem are the permissions. you must set both files to rw-r-r otherwise it does not work.
Thanks! works! love it!
 
Fusionalex
Old
(Last edited by Fusionalex; 27th December 2013 at 07:19 AM.) Reason: Updated link
#10  
Senior Member
Thanks Meter 34
Posts: 193
Join Date: May 2012
Location: Vienna
Quote:
Originally Posted by cclaxx View Post
guys maybe the problem are the permissions. you must set both files to rw-r-r otherwise it does not work.
Thank you so much it works perfectly! I love this!
Maybe someone should create a flashable zip to make this easier tho

EDIT:
I quickly tried to make a flashable zip. Never did this before so I'm not sure if I did it right. Maybe someone can check it and tell me if everything should work
I took the update-binary from CM11 because I wasn't sure if the older one from the tutorial I read would work.
http://ge.tt/8kOOWOB1?c
I don't know if it works and if it doesn't I am not responsible for any damage done to your devices. I just hope someone here who has more experience than me can check it out and confirm if it works

The Following 5 Users Say Thank You to Fusionalex For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes