[MOD] Apple Color Emoji system-wide for KitKat+ (updated with unicorns)

Search This thread

angelsel

Senior Member
Jan 16, 2011
50
168
Singapore
Screenshot:
zh8nbcR.png


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/fonts.xml like so:
    • Find
      Code:
          <family>
              <font weight="400" style="normal">NotoSansSymbols-Regular-Subsetted.ttf</font>
          </family>
    • Above this block, add
      Code:
          <family>
              <font weight="400" style="normal">AppleColorEmoji.ttf</font>
          </family>
  4. Set /system/etc/fonts.xml to have permissions 644 (rw-r--r--) and owner:group root:root.
  5. Reboot.
(Thanks cclaxx for mentioning permissions!)

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

Screenshots (warning: large)
Pc7jjnD.png

DqIen5J.png

319e8yT.png

AqwURLW.png

W3PJYOA.png

izGfHfp.png

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

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).

Update: No need to do all this anymore. Later versions of Android support sbix out of the box. Just adjust the platEncID/platformID in the cmap of AppleColorEmoji.ttf.

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.


Update: I've updated this for the iOS 9.1/unicorn emoji. Details here
Update: ligatures (mostly) now work. details

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.
 
Last edited:
Y

yener90

Guest
Looked for it great :D

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 :fingers-crossed:
 

angelsel

Senior Member
Jan 16, 2011
50
168
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.
 

d2616ae26016

Senior Member
Nov 28, 2013
66
3
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?
 

cclaxx

Senior Member
Jul 5, 2012
144
48
milano
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?

Also didnt work for me. Omni rom 4.4.2

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.
 

Fusionalex

Senior Member
May 21, 2012
251
69
Vienna
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 :)
 
Last edited:

Iceman_jkh

Senior Member
Aug 10, 2010
241
31
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.
https://mega.co.nz/#!xFFSRLZS!ITICxm3LSw1PKxDYzAaPbloCGwMlt4JnDohepI4YiRo
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 :)

Great work.
Is the update via zip reversible?
If so, I'm willing to give it a try.

Sent from my GT-I9300 using Tapatalk

---------- Post added at 10:35 AM ---------- Previous post was at 09:35 AM ----------

Firstly, BIG THANKS to Angelsel, FusionAlex and cclaxx!

If you don't want to use the zip, simply download it and then extract the files (TTF and XML) out of the /etc and /fonts directories.

Summary of instructions:
1. Backup your fallback_fonts.xml file on your phone (found at: /system/etc/fallback_fonts.xml)
2. Copy the new fallback_fonts.xml into the /system/etc/ directory.
3. Set fallback_fonts.xml's file permissions to rw-r--r--
4. Copy the AppleColorEmoji.ttf into the /system/fonts/ directory. (Don't worry about overwriting anything, because this is a new file, it doesn't overwrite any of your other fonts).
5. Set AppleColorEmoji.ttf's file permissions to rw-r--r--
6. Reboot your phone.
7. Enjoy

The reason you don't have to overwrite any actual fonts is because the fallback_fonts.xml has been amended to look at the new (AppleColorEmoji.ttf) font before checking the standard android ones.

:)
 

Fusionalex

Senior Member
May 21, 2012
251
69
Vienna
Great work.
Is the update via zip reversible?
If so, I'm willing to give it a try.

Well I'm not sure. It's possible that it won't even flash because I might have done something wrong. In fact it should of course be reversible because the only thing it's supposed to do is copy the 2 files and fix the permissions of them. Still I'd rather have someone who knows how those zips work take a look at it before someone tries it, because I don't have any experience ;)

EDIT:
I took another look at some more recent flashable zips and changed some stuff again. I also decided to upload the unsigned zip in case someone wants to edit the zip and sign it :)
http://ge.tt/8kOOWOB1?c

EDIT 2:
OK, I think, that my zip would also work, but I found an app called ZIPme and created a flashable zip with it. It works perfectly (I just tested it on my phone)
So finally:
Enjoy this flashable zip of this amazing mod:
https://mega.co.nz/#!JU0nRAZY!Pbv9Gy5tS8e5pIjDX8OuZzSnkVA3zegHlXD_ImAGXIc

PS. If some experienced DEV could take a look at my original zip tho and told me if i did everything right I would still be happy ;)
 
Last edited:

angelsel

Senior Member
Jan 16, 2011
50
168
Singapore
Well I'm not sure. It's possible that it won't even flash because I might have done something wrong. In fact it should of course be reversible because the only thing it's supposed to do is copy the 2 files and fix the permissions of them. Still I'd rather have someone who knows how those zips work take a look at it before someone tries it, because I don't have any experience ;)

EDIT:
I took another look at some more recent flashable zips and changed some stuff again. I also decided to upload the unsigned zip in case someone wants to edit the zip and sign it :)
http://ge.tt/8kOOWOB1?c

EDIT 2:
OK, I think, that my zip would also work, but I found an app called ZIPme and created a flashable zip with it. It works perfectly (I just tested it on my phone)
So finally:
Enjoy this flashable zip of this amazing mod:
https://mega.co.nz/#!JU0nRAZY!Pbv9Gy5tS8e5pIjDX8OuZzSnkVA3zegHlXD_ImAGXIc

PS. If some experienced DEV could take a look at my original zip tho and told me if i did everything right I would still be happy ;)

Ge.tt and Amazon S3 seems to hate me. I can't download your original zip.

The second zip will work fine, but there is no need to set permissions - extract_dir's default permissions (and file ownership) are already correct. This zip sets the owner/group to 1000/1000 (system, iirc) which is not correct; the files should be owned by root (uid/gid 0, naturally).

Thanks for creating a flashable zip :)
 
  • Like
Reactions: Fusionalex

Fusionalex

Senior Member
May 21, 2012
251
69
Vienna
Ge.tt and Amazon S3 seems to hate me. I can't download your original zip.

The second zip will work fine, but there is no need to set permissions - extract_dir's default permissions (and file ownership) are already correct. This zip sets the owner/group to 1000/1000 (system, iirc) which is not correct; the files should be owned by root (uid/gid 0, naturally).

Thanks for creating a flashable zip :)

Hm I can upload the original zip somewhere else later :)

Oh ok, I didn't know that extract_dir already sets the permission :) Also the zip was created by an app :) It still works but I will try to change it maybe :)) Thanks!
 

AMoosa

Senior Member
Sep 24, 2006
2,083
337
Samsung Galaxy Z Fold2
This is really good but the font seems to be incomplete. I get messages that just show a square instead of the emoji in the notification bar.

Sent from my GT-I9505G using Tapatalk
 

qazsxdcfv

Senior Member
Sep 22, 2011
713
93
Behind the road
Wow very cool and based on the screenshots , You did resize all of the image ? :eek:
Cool ..

Wait , why didnt we just replace the AndroidEmoji.ttf and change it to AppleColorEmoji.ttf ? I think its the same ..

Sent from my Nokia 3310™
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 118
    Screenshot:
    zh8nbcR.png


    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/fonts.xml like so:
      • Find
        Code:
            <family>
                <font weight="400" style="normal">NotoSansSymbols-Regular-Subsetted.ttf</font>
            </family>
      • Above this block, add
        Code:
            <family>
                <font weight="400" style="normal">AppleColorEmoji.ttf</font>
            </family>
    4. Set /system/etc/fonts.xml to have permissions 644 (rw-r--r--) and owner:group root:root.
    5. Reboot.
    (Thanks cclaxx for mentioning permissions!)

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

    Screenshots (warning: large)
    Pc7jjnD.png

    DqIen5J.png

    319e8yT.png

    AqwURLW.png

    W3PJYOA.png

    izGfHfp.png

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

    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).

    Update: No need to do all this anymore. Later versions of Android support sbix out of the box. Just adjust the platEncID/platformID in the cmap of AppleColorEmoji.ttf.

    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.


    Update: I've updated this for the iOS 9.1/unicorn emoji. Details here
    Update: ligatures (mostly) now work. details

    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.
    8
    Great work.
    Is the update via zip reversible?
    If so, I'm willing to give it a try.

    Well I'm not sure. It's possible that it won't even flash because I might have done something wrong. In fact it should of course be reversible because the only thing it's supposed to do is copy the 2 files and fix the permissions of them. Still I'd rather have someone who knows how those zips work take a look at it before someone tries it, because I don't have any experience ;)

    EDIT:
    I took another look at some more recent flashable zips and changed some stuff again. I also decided to upload the unsigned zip in case someone wants to edit the zip and sign it :)
    http://ge.tt/8kOOWOB1?c

    EDIT 2:
    OK, I think, that my zip would also work, but I found an app called ZIPme and created a flashable zip with it. It works perfectly (I just tested it on my phone)
    So finally:
    Enjoy this flashable zip of this amazing mod:
    https://mega.co.nz/#!JU0nRAZY!Pbv9Gy5tS8e5pIjDX8OuZzSnkVA3zegHlXD_ImAGXIc

    PS. If some experienced DEV could take a look at my original zip tho and told me if i did everything right I would still be happy ;)
    6
    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 :)
    5
    OK, I take that back.

    It turns out that the ligatures are stored in the morx table in the Apple fonts, which FreeType does not support.

    FontForge is able to convert most morx ligatures to GSUB ligatures, which is the kind supported in FreeType (and in fact used in Noto Color Emoji, Android's own emoji font).

    I modified the script to inject GSUB and supporting tables from FontForge (it's a bit hacky, but it'll have to do). To whoever uses the script in future: to update the GSUB table you need to open and export the Apple font in FontForge (it will convert the relevant tables), dump the resulting TTF with TTX, then remove all the tables except GSUB and GDEF (and GPOS if you want, not really needed). Or some other way, if you want, just insert those tables into the TTF the script produces.

    Here is an updated AppleColorEmoji.ttf.

    Screenshot:
    zh8nbcR.png


    The man-kiss-man and woman-kiss-woman ligatures do not work. The rest work.
    4
    Guys, OP did a great job, BUT there is an app for this in the playstore its called Emoji Switcher, you require root tho... But Its really easy just choose iOS emojis and press switch and it will reboot and done. https://play.google.com/store/apps/details?id=com.stevenschoen.emojiswitcher is the link