fontify icon indicating copy to clipboard operation
fontify copied to clipboard

Support for chromatic fonts

Open mateusfccp opened this issue 4 years ago • 2 comments

Flutter supports rendering chromatic icons.

However, when I use fontify on a set of .svg files in which some of them have colors, the resulting .otf has a single and monochromatic shape.

For example, for this SVG:

Screen Shot 2021-05-06 at 15 58 12

The result glyph is: Screen Shot 2021-05-06 at 15 58 43

Is there a way to preserve SVG colors when generating an .otf with fontify?

mateusfccp avatar May 06 '21 18:05 mateusfccp

As I was giving a look, it seems fontify does not works with SVG table, and I think this is the reason my SVGs colors disappear. Is that right?

mateusfccp avatar May 07 '21 10:05 mateusfccp

Ok, so I made some tests and it seems that even if I put an SVG Table in the font generated by fontify with the desired SVG, Flutter will render it like described in the issue, which makes me think that Flutter doesn't support SVG tables at all.

(I patched SVGs into the generated font with opentype-svg)

I also tested COLR/CPAL fonts and they also didn't work properly (although they at least kept the shape as expected, but using the IconTheme color).

The only font that I tested and properly displayed colored glyphs was Noto Sans Emoji, which is, apparently, a CBDT font. This is disappointing, as bitmaps doesn't scale well...

Anyway, if we want to proceed with this idea, we will have to process the given SVG into a CBDT font.

mateusfccp avatar May 09 '21 02:05 mateusfccp

This repository seems to have been abandoned. Thus, I am closing this.

mateusfccp avatar Sep 12 '22 10:09 mateusfccp

Related: https://github.com/flutter/flutter/issues/79365

mateusfccp avatar Sep 26 '22 20:09 mateusfccp