Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codepoint naming incorrect #67

Closed
klingberg opened this issue Jul 10, 2015 · 6 comments
Closed

Codepoint naming incorrect #67

klingberg opened this issue Jul 10, 2015 · 6 comments

Comments

@klingberg
Copy link

Hi!

I can't get the latest release to work properly.
This is my gulpfile:

var gulp = require('gulp');
var iconfont = require('gulp-iconfont');

gulp.task('Iconfont', function(){
  gulp.src(['icons/*.svg'])
    .pipe(iconfont({
      fontName: 'myfont', // required
      appendUnicode: true // recommended option
    }))
      .on('glyphs', function(glyphs, options) {
        // CSS templating, e.g.
        console.log(glyphs, options);
      })
    .pipe(gulp.dest('fonts/'));
});

When I run the task the first time this is generated:

uEA01-twitter.svg

If I add another icon (facebook.svg) and run the task again I get this error:

Error: The unicode codepoint of the glyph twitter seems to be already used by another glyph.

And these are the svg's generated:

uEA01-twitter.svg
uEA01-facebook.svg

I use:

gulp-iconfont v3.0.2
gulp v3.9.0
node v0.12.7

Seems like someone had a similar problem #53
Everything works fine with the same setup but with gulp-iconfont v1.0.1

Cheers!

@nfroidure
Copy link
Owner

Hi!

I'm unable to reproduce this issue. I made a lot of test to try to detect this but with no success.

Could you create a repo with the minimal setup to reproduce it ?

Also, you should try to use the current repo state to test if the next release will fix your issue.

@klingberg
Copy link
Author

I see!

Here is a repo with my tests https://github.com/klingberg/icon-test
I also found that if I have both the icons in the folder and run the task it works like a charm.
But if I add one icon and run the task and then add another and run the task again the problem occurs.

I also get this waring during npm install if it's any help:

npm WARN engine svg-pathdata@1.0.0: wanted: {"node":"0.10.*"} (current: {"node":"0.12.7","npm":"2.11.3"})

@sabberworm
Copy link
Collaborator

Is it maybe related to the case-sensitivity of the file system used? Or whether the “u” or one of the characters in the hex code are upper- or lowercased?

@nfroidure
Copy link
Owner

I reproduced the problem. It sits in gulp-svgicons2svgfont. The metadata provider needs to have the file inputed in order but since in gulp streams they comes in an unknown order, it doesn't work.

We can:
1- buffer files in gulp-svgicons2svgfont, sort them and pass them to the metadata provider
2- change the meta data provider to buffer files, wait for an end callback, sort the files, provide metadata and finally callback every files callbacks.

I'm currently not sure which fix is better. Feel free to give your advice.

@uriklar
Copy link

uriklar commented Aug 17, 2015

I'm also receiving this error when adding a new svg file to an existing folder. I'm using version 4.0.0 of the library. Any solution? This happens regardless of what value I put in appendUnicode option.
Thanks

@nfroidure
Copy link
Owner

You can help by following those steps #72 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants