Comments (12)
Hi, it's alive and kicking. I would be happy to work with you to achieve these goals.
from font-awesome-svg-png.
Cool, will look at it more on Monday :)
from font-awesome-svg-png.
@dominykas The existing code is really a mess. The generated SVG files actually change depending on whether you are generating PNG files due to some side effects…
Since I don't care about PNG, I wrote a simpler script in ES6 at https://github.com/riobard/font-awesome-svg/blob/master/build.js It does not download icons.yml
at all.
Let me know if it would be useful to clean up here.
from font-awesome-svg-png.
Yeah, I admit the whole thing was put together quite quickly and pushed to Github in hope it's useful to someone. For me the most common use case turned out to be pixel perfect pngs.
from font-awesome-svg-png.
@dominykas @riobard I have just updated the package to utilize promises, split up some parts of the code, move out sprites to a separate function, fix the side effects problem and so on ... I doubt I will have time next week to split the generation code to an API but I would welcome such PR.
from font-awesome-svg-png.
@Rush Great to see the clean up and thanks a lot for the initial work to get it started :)
However, your viewBox
calculation is still wrong. See cc-visa.png
for example. The icon is not a square and your method cut it off at the edge. There are many other instances like this. Please refer to my implementation for the correct method https://github.com/riobard/font-awesome-svg/blob/master/build.js#L35
from font-awesome-svg-png.
Yeah, looks kind of blurry :-( https://raw.githubusercontent.com/encharm/Font-Awesome-SVG-PNG/master/black/png/16/credit-card.png
from font-awesome-svg-png.
@riobard neat trick with the less variable parsing - totally copy/pasted that: insidewarehouse@c185a18
Only yours needs two minor tweaks:
- regex should include numbers (to match
html5
,css3
) - I went for\w
- instead of trying to read from
node_modules
you should userequire.resolve
as that will find the installed module correctly, using node's default logic (be it global or installed with a parent package or whatever)
I then compared the generated list with what was being read from the yaml, and found that it's actually the same plus it has all the aliases
that were not taken into account.
Will PR later.
from font-awesome-svg-png.
@dominykas Awesome and thanks for the tweaks! 👍 Can't wait for the PR to come.
I believe Font Awesome generates its variables.less
from the YAML file by flattening the alias list per icon anyway. The drawback with parsing variables.less
is that there's no way to know which alias is the canonical one. I'm totally fine with that though :D
from font-awesome-svg-png.
OK, I think I'm done for now - there's plenty that can still be done, but I've split the code up enough so that I can find my way around it so that I could extract the primary generate()
function (can be used separately, e.g. inside a grunt task). I've also made this depend on font-awesome
package and I've added the --dest
option for output folder. This is now good enough for our own internal use :)
Please review/comment/merge/publish :)
Once that's out - I'll go PR the grunt tasks... Going by node's philosophy, they shouldn't be built into this package.
from font-awesome-svg-png.
@dominykas merged, many thanks
from font-awesome-svg-png.
Shall we close this issue then?
from font-awesome-svg-png.
Related Issues (20)
- Instagram HOT 2
- Missing file-th HOT 1
- Thanks for the inspiration - check out my package `font-awesome-assets` HOT 1
- Error on launching app HOT 7
- Issue with Font Awesome 4.7.0 HOT 1
- Cannot read property 'charCodeAt' of undefined HOT 10
- fa-user-circle missing HOT 2
- SVG is invalid HOT 5
- Bower deprecation; adding complete package to npm? HOT 3
- Asking users for opinion - padding or not? HOT 1
- Break generating svg HOT 1
- Wide icons are not full displayed in the github repo HOT 1
- Upgrade graceful-fs dependency HOT 1
- New icons in Font Awesome 5.0 HOT 6
- Nice job! See my repo `local-icons` in order to use these icons in a very easy way. HOT 4
- rsvg-convert.exe download link is dead
- SVG icon background
- Redo icon
- Licensing HOT 4
- Convert font-awesome pro icons
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from font-awesome-svg-png.