itgalaxy / webfont

Awesome generator of webfont
MIT License
276 stars 69 forks source link

feat: support `files` from `config` file #2

Open shankar78be opened 7 years ago

shankar78be commented 7 years ago

Hi,

When i run the below command the icon is created only the svg file specified in the cmd line. I have specified 2 files in the webfont.config.json. How to create icons for the 2 SVG files specified in the json file.

cmd> webfont "src/assets/images/action-sheet-check.eps.svg" --dest "src/assets/icons2" -s "src/assets/icons2/dfw.css" --config "webfont.config.json"

webfont.config.json

{ "files": [ "src/assets/images/action-sheet-check.eps.svg", "src/assets/images/arrow-left-black-sm.eps.svg" ], "dest": "src/assets/icons2", "dest-css-template": "src/assets/icons2/dfw.css", "fontName": "my-font-name" }

alexander-akait commented 7 years ago

@shankar78be Thanks for reporting

alexander-akait commented 7 years ago

@shankar78be you want create two fonts?

shankar78be commented 7 years ago

Yes, I want to create web fonts for the 2 images specified in the config file "src/assets/images/action-sheet-check.eps.svg" "src/assets/images/arrow-left-black-sm.eps.svg"

Is there a sample project that i can refer too ?

alexander-akait commented 7 years ago

@shankar78be Poor understand, describe the problem in detail what you want to get and what you get is actually

shankar78be commented 7 years ago

I have configured the package.json to generate the webfonts. In the prebuild, the webfont were configured with the following parameters input, dest & destcsstemplate. It works fine, created webfonts for the SVG images located inside the images folder. "scripts": { "prebuild": "webfont src/assets/images/*.svg --dest src/assets/icons -s src/assets/icons/dfw.css", "start": "npm run server" }

If I need to generate webfonts based on the configuration specified webfont.config.json, what needs to be done ?

webfont.config.json

{ "files": [ "src/assets/images/action-sheet.svg", "src/assets/images/arrow-left.svg" ], "dest": "src/assets/icons", "dest-css-template": "src/assets/icons/dfw.css", "fontName": "webfont" }

Need help on this.

alexander-akait commented 7 years ago

@shankar78be Thank you for the detailed description, it is now clear, tomorrow I'll see what I can do, i see you want give an opportunity use files (glob) and dest* options in webfont.config.json. Now it is supported only for CLI (https://github.com/itgalaxy/webfont/blob/master/src/cli.js#L210 and below).

alexander-akait commented 7 years ago

@shankar78be you can use files for CLI or in config file, it can not be used in both, i fixed this throw error if you use CLI and config file contain files.

jimmyandrade commented 3 years ago

@shankar78be did you manage to solve what you needed? If so, I will be happy to close this issue. Otherwise, please tell me to see how I can help you.