ilikerobots / polyicon

Flutter icon set generator
http://fluttericon.com
MIT License
421 stars 49 forks source link

Error: invalid signature when fontello-cli installs config with zero icons selected #7

Open brent-williams opened 5 years ago

brent-williams commented 5 years ago

The fluttericon.com site is great but I'd like to integrate the svg -> ttf process into an automated build. Below gives an error on a simple test of two svg files, the config file came from fluttericon.com. Any pointers/suggestions on where I can go to resolve? Many thanks.

font % fontello-cli --config ./config.json --host fluttericon.com install
Install complete.
(node:76114) [DEP0026] DeprecationWarning: util.print is deprecated. Use console.log instead.
events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: invalid signature: 0x3030355b
    at /Users/brentww/.nvm/versions/node/v11.4.0/lib/node_modules/fontello-cli/node_modules/unzip/lib/parse.js:63:13
    at processImmediate (timers.js:632:19)
Emitted 'error' event at:
    at Parse.<anonymous> (/Users/brentww/.nvm/versions/node/v11.4.0/lib/node_modules/fontello-cli/node_modules/unzip/lib/extract.js:28:10)
    at Parse.emit (events.js:189:13)
    at /Users/brentww/.nvm/versions/node/v11.4.0/lib/node_modules/fontello-cli/node_modules/unzip/lib/parse.js:64:12
    at processImmediate (timers.js:632:19)
font %

config.json:

{
  "name": "",
  "css_prefix_text": "",
  "css_use_suffix": false,
  "hinting": true,
  "units_per_em": 1000,
  "ascent": 850,
  "glyphs": [
    {
      "uid": "af8d26a5cd87b57720d2060635efcef2",
      "css": "clam",
      "code": 59392,
      "src": "custom_icons",
      "selected": false,
      "svg": {
        "path": "M924 426C464 218 150 400 78 452 82 488 90 522 104 556 228 486 514 378 904 540 916 502 922 464 924 426ZM806 714C540 626 332 668 204 720 228 752 256 786 286 818 400 788 548 774 724 816 754 782 782 748 806 714ZM888 578C508 420 234 528 120 594 136 624 160 660 178 688 314 632 540 582 830 680 858 638 874 610 888 578ZM76 404C182 338 490 192 922 380 918 328 904 282 884 242 486 78 204 206 102 268 86 310 76 354 76 404ZM320 852C374 904 436 950 506 980 576 948 638 902 690 850 542 820 418 828 320 852ZM850 182C728 24 504 20 504 20 504 20 504 20 504 20 504 20 504 20 504 20 504 20 258 24 138 202 270 138 518 64 850 182Z",
        "width": 1000
      },
      "search": [
        "clam"
      ]
    },
    {
      "uid": "81078491c4dde58c63db3009f9311ec7",
      "css": "fish",
      "code": 59393,
      "src": "custom_icons",
      "selected": false,
      "svg": {
        "path": "M958 426C970 408 980 398 980 398 916 398 864 460 864 460 856 466 848 478 842 490 776 448 790 364 790 364L756 372C642 284 626 232 626 232L558 252C556 234 574 206 574 206 542 204 494 228 494 228 492 204 512 172 512 172 400 160 364 260 364 260 92 274 24 568 20 586 52 588 110 588 144 570L154 588C124 604 80 608 46 608 40 608 32 608 26 608 60 684 156 724 236 744 262 720 318 646 282 502L322 492C356 630 314 712 282 754 330 762 366 764 366 764 386 848 508 830 508 830 482 796 492 758 492 758 522 764 624 728 624 728 706 808 726 774 726 774 726 732 742 696 742 696 746 684 794 656 826 638 840 664 862 696 862 696 896 744 978 756 978 756 948 742 928 682 920 650 912 618 884 578 884 578 918 550 910 498 958 426ZM120 518C108 518 96 508 96 494 96 482 106 470 120 470 134 470 144 480 144 494 144 508 134 518 120 518Z",
        "width": 1000
      },
      "search": [
        "fish"
      ]
    }
  ]
}
ilikerobots commented 5 years ago

@brent-williams, I believe the problem is that there are no icons "selected." Uploading custom svg isn't sufficient to include them in the output TTF/Dart package; they also need to be selected.

You can either select them in the web interface by clicking on them and re-download the config, or just change "selected": false to "selected": true, for the two icons directly in the config.json file.

ilikerobots commented 5 years ago

I'll leave this ticket open to create a nicer error message when this happens.

brent-williams commented 5 years ago

Thanks @ilikerobots, I can confirm changing selected to true got rid of the error. Leaving issue open for you to resolve when you see fit.