Comments (12)
It's not a webfont bug, it's a problem with svgicons2svgfont package. And solution is quite simple. You don't need to export big svg images from Illustrator, or add empty svg images with big size, just set propper options in config - fontHeight: 600
and normalize: true
.
from webfont.
Worked with the designer and we found out after multiple SVG export form illustrator and sketch that:
- Sketch export did not work at all for this. Something with the fill-mode i suppose. Either the fills where behaving unexpectedly or the fills where inverted.
- Illustrator needs to export a large SVG. We used 512px*512px
- All shapes needs to be finalized and using "Compound path".
I think this was/is issues that touches both the SVG export and the rendering of fonts. The SVG export from illustrator seems to have issues when exporting small sized complex shapes. This in turn made the generator confused while optimizing the icon.
The safe way of working with this seems to be to go large. I am not sure why, since SVGs are using bezier curves, but this is probably nice to mention in the readme and could be worth looking into in the future. :)
Thanks for letting me rubberduck debug this over here. Hope it helps some else! :D
from webfont.
@evilebottnawi
I expected this (screenshot from OSx preview:
And i got this (screenshot from webpage where icon font has rendered font from SVG):
from webfont.
@japalo can your provide what your expected and what is actually happens?
from webfont.
When i tried to boost up the size of the icons to 512px * 512px instead of 56px * 56px the lines smoothed out a bit, but the fill was weird instead. Will try to edit SVGs in order to update you.
from webfont.
@japalo do your use svgo
or some similar tools?
from webfont.
@japalo great! If you have the time to do PR (add this caveat to readme), I will be happy, thanks!
from webfont.
@japalo Thanks for sharing your notes; was running into issues of lossiness for a particular icon that went away when I resized to 512x512 (and added the --normalize
flag)
from webfont.
I found out that the problem was related to the low units-per-em
in svg's font-face
definition. I solved it putting there empty svg that had size of 600px x 600px and the font-face
adjusted units-per-em
to the biggest svg image it found. It works fine like this :)
from webfont.
When adding complex icons some SVG optimization messes up the icons.
@japalo were you able to solve the problem after the suggestion of @noiff?
If so, I would like to close this issue. Otherwise, feel free to respond and I will try to help you.
from webfont.
@jimmyandrade oh, this was a long time ago i actually can't remember. That must have been the solution since i didn't comment anything further.
I will close this issue, and thank @noiff for the solution I must have missed to do two years back.
from webfont.
@japalo no prob 😄 Feel free to reopen the issue, in case you encounter this problem again.
And sorry for the delay in answering, we are resuming activities in this repository now, as we have more people contributing.
from webfont.
Related Issues (20)
- Not generating font. HOT 1
- generate data:application/x-font-woff;charset=utf-8;base64,... URL style in templates HOT 1
- Wrong filename in template.njk if fontName and templateFontName configured
- NPM audit fail due to vulnerable dependency on svg2ttf HOT 2
- add browser compatability HOT 5
- Incomplete after compilation HOT 1
- Support of ligatures should be configurable
- Globby now uses ESM HOT 5
- Cannot use import statement outside a module HOT 7
- Error when passing path to javascript config file via '--config' flag HOT 1
- Auditing webfont reveals moderate vulnerability in xmldom HOT 6
- Cannot read property 'dirname' of undefined HOT 2
- Extreme slowdown on fonts generated by `webfont` HOT 1
- please synchronize versions in npm registry, releases and tags page
- CLI round parameter is passed as a string in SVGPathData (Bug)
- Update cosmiconfig module to latest upstream release HOT 1
- svgicon2svgfont.log not implemented
- Is this still maintained?
- 如何让webfont支持transform属性
- TypeError: webfont is not a function HOT 1
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 webfont.