ecomfe / gulp-fontmin

Minify font seamlessly
MIT License
80 stars 13 forks source link

Allow to pass directory to generated font url in css #1

Closed olegstepura closed 9 years ago

olegstepura commented 9 years ago

Hi!

Great plugin! The only issue is that you cannot control where generated css links fonts to. It's always current dir. But in case you concatenate generated css file to your main css file, fonts may be located in other dir, so it would be very helpful to have ability to control this.

example: knowing that my fonts would be located in dir ../fonts/ relative to css file location I add an option

cssFontPath: '../fonts/'

to gulp plugin and the generated css has urls like url(../fonts/myfont.ttf) (notice the ../fonts/ in front of font name).

Also please note there are different comma symbols in comments of generated css

chrome、firefox、opera、Safari, 
      ↑                       ↑
   strange                 regular

Thanks!

otakustay commented 9 years ago

The symbol is simply a Chinese symbol which means "these words are tightly relative", for an internationalized lib it should be fixed to comma , @junmer

junmer commented 9 years ago

@olegstepura @otakustay Thanks for your issue. It's a useful feature. I have added option fontPath for font file location. and, is my carelessness, I fixed it into , lastest version.

Please use npm i gulp-fontmin@0.7.0 :smiley:

olegstepura commented 9 years ago

Great job! It works as expected.