How to generate colour bitmap fonts for Mac OS 10.7/8

Jens Kutilek's picture

A while ago I researched out of curiosity if it was possible to build fonts with embedded colour bitmaps like the Apple Color Emoji font on Mac OS 10.7/10.8. I figured out the «sbix» table format and wrote some code that can be hooked into the Python FontTools to decompile and compile the sbix table which contains the image data.

Some of my research was generously allowed to happen during my working hours at FontShop International.

After pondering for a while what to do with this knowledge, me and FontShop International finally decided to make the code public to encourage experimentation.

So without further ado, please check out the attached demo scripts. |


Add the three files in to the directory ttLib/tables of your existing FontTools installation. You can probably find it in /Library/Python/2.7/site-packages/fontTools/.


Check out the demo scripts in for examples of how to build your own colour bitmap font or extract the images from an existing font. If you want a proof of concept, view the included ColorTestSbix.ttf on Mac OS X. It should look like in the included font book screenshot. The name ColorTest is a bit misleading as it’s only a scanned typewriter face in greyscale ;)

If you just run, it will add the pngs from set_150 to the file ColorTest.ttf and save the resulting font as ColorTestSbix.ttf.

If you have the original Apple Color Emoji font, you can use to extract the pngs from it. They will be saved in the extracted directory.

Have fun!

fontbookColor.png150.08 KB


hrant's picture

Jens, wonderful! Very nice of you (and FSI). I'm going to sit down and give this a shot. But is it limited to running on OSX?

BTW is the "reverse-engineering" of the sbix table something Apple could complain about?


Jens Kutilek's picture

Hrant, the Python scripts are not limited to OS X. But Windows doesn’t come with any Python preinstalled, so you have to install it first (and then the Python FontTools) if you don’t have it. (Of course the generated fonts will not show any bitmaps on Windows.)

Regarding the reverse-engineering, I’m not the first one who has figured out the sbix format, or built a proof-of-concept font (Theunis de Jong did so in, so my maybe naive view is that if Apple wasn’t OK with it, they would have complained already ;)

Jens Kutilek's picture

Somebody reported a bug in that would affect fonts with more than one bitmap size. The offset of the 2nd and all following sets was off by 8 bytes. I have corrected the bug and uploaded the new file to the link above.

dinobib's picture

That's a nice experimentation.
I was playing around with it and it seems I encounter a problem now that I am on Mavericks.
The script doesn't find the font and say
IOError: [Errno 2] No such file or directory: 'ColorTest.ttf'
Last time I look at it, I was on Mountain Lion and didn't face this problem.
Did you know in Maverick what is causing the script or python to fail to see the font file ?
Thanks for your help.


Syndicate content Syndicate content