joypixels / emojione

[Archived] The world's largest independent emoji font. Maintained at https://github.com/joypixels/emoji-toolkit.
https://www.joypixels.com
Other
4.46k stars 533 forks source link

CPAL/COLR-based font? #190

Open flying-sheep opened 8 years ago

flying-sheep commented 8 years ago

microsoft has published a multicolor OpenType extension using new COLR and CPAL tables.

this format is perfect for flat emoji like ours (and supported by firefox and IE/Edge)

13rac1 commented 8 years ago

The major issue with implementing this format is that the SVGs need to be broken apart into separate SVG files for each color layer. It shouldn't be too bad to implement a converter, but I haven't gotten to it yet. If you want something now, the SVGinOT version of this font I've made works well in Firefox, but falls back to my b&w glyphs in IE/Edge.

flying-sheep commented 8 years ago

the SVG structure looks good!

basically it’s 1 <g/> or <path/> per color. we’ll simply have to check if this is the case or sth. more complex goes on (per SVG), and if not, we can directly convert those groups or paths into splines for the font.

13rac1 commented 8 years ago

Seems it'll get inefficient for complex SVGs like this one:https://github.com/Ranks/emojione/blob/master/assets/svg/1f486-1f3fb.svg It has 16 paths and there are currently 21,035 paths in the emojione set, so it really needs to be a smart system. My current plan for the build system is to implement SBIX, then CBLC/CBDT. I'd add COLR/CPAL too if a good method to break apart SVGs can be found.

flying-sheep commented 8 years ago

bitmaps in (otherwise) vector fonts are a stupid idea.

if you’re a chat software and can control your font size, OK, use, a rich text widget to intermingle bitmap graphics with text.

but inside of a font that can be scaled to any size? that just doesn’t make sense.

13rac1 commented 8 years ago

The CBLC/CBDT standard is part of OpenType and SBIX is supported by millions of computers. I'd rather there was only SVGinOT, but for historical and technical reasons the other three are all reasonable. Could this discussion stay technical?

We need a method to separate SVGs into their component layers in new SVG files. Ideally in a Python library (since scfbuild is written in Python), but an external program or even just an algorithm description could work.

Relevant: I've found a mirror of the source for the Inkscape Export to Layers extension here: https://github.com/inkscape/inkscape/blob/master/inkscape-launchpad/share/extensions/tar_layers.py Seems like it could do what's needed.

flying-sheep commented 8 years ago

The CBLC/CBDT standard is part of OpenType

aren’t all four in OpenType? (google bitmap (CBLC/CBDT), apple bitmap (SBIX), MS vector (COLR/CPAL), SVG)

13rac1 commented 8 years ago

SBIX is not. There's no reason for two bitmap formats. Apple didn't open their specification in time or didn't care or ??? to get it put into OpenType. CBLC/CBDT is used in Android and will be implemented at some point in Windows/Linux and I assume OS X.

13rac1 commented 8 years ago

I realize I could be more clear: SBIX is an OpenType table, but it is not in the OpenType specification: https://www.microsoft.com/typography/otspec/otff.htm#otttables

jfkthame commented 8 years ago

There's a project to do a COLR/CPAL conversion of EmojiOne (using a somewhat ad hoc layerization/conversion script -- it's not perfect, but results look pretty good) at https://github.com/mozilla/emojione-colr.

A test page that shows the output (works in Firefox, can't speak for other browsers) is at https://people.mozilla.org/~jkew/tests/emoji-list.html.

ara4n commented 5 years ago

@jfkthame https://people.mozilla.org/~jkew/tests/emoji-list.html 404s now - is there anywhere else to find a test page?