@@ -4,31 +4,34 @@ var gulp = require('gulp'),
44 iconFont = require ( 'gulp-iconfont' ) ,
55 iconFontCss = require ( 'gulp-iconfont-css' ) ,
66 runTimestamp = Math . round ( Date . now ( ) / 1000 ) ,
7- extend = require ( "xtend" ) ;
7+ extendOptions = require ( 'extend-options' ) ;
88
99
1010elixir . extend ( 'fonts' , function ( src , output , options ) {
1111
1212 options = options || { } ;
13- var fontName = '_font_icons' ,
14- elixirConfig = this . config ,
15- config = {
16- font : {
17- normalize : true ,
18- fontName : fontName , // required
19- prependUnicode : false , // recommended option
20- formats : [ 'ttf' , 'eot' , 'woff' , 'woff2' , 'svg' ] , // default, 'woff2' and 'svg' are available
21- timestamp : runTimestamp // recommended to get consistent builds when watching files
22- } ,
23- css : {
24- fontName : fontName ,
25- targetPath : '../../' + elixirConfig . assetsPath + '/' + elixirConfig . css . sass . folder + '/' + fontName + '.scss' ,
26- fontPath : '../fonts/'
27- }
28- } ;
13+ options . font = options . font || { } ;
14+ options . css = options . css || { } ;
15+ var fontName = '_font_icons' ;
16+ options . font . fontName = options . font . fontName || fontName ;
17+ var elixirConfig = this . config ,
18+ config = {
19+ font : {
20+ normalize : true ,
21+ fontName : options . font . fontName , // required
22+ prependUnicode : false , // recommended option
23+ formats : [ 'ttf' , 'eot' , 'woff' , 'woff2' , 'svg' ] , // default, 'woff2' and 'svg' are available
24+ timestamp : runTimestamp // recommended to get consistent builds when watching files
25+ } ,
26+ css : {
27+ fontName : options . font . fontName ,
28+ targetPath : '../../' + elixirConfig . assetsPath + '/' + elixirConfig . css . sass . folder + '/' + options . font . fontName + '.scss' ,
29+ fontPath : '../fonts/'
30+ }
31+ } ;
2932
30- config = extend ( config , options ) ;
31- console . log ( config ) ;
33+ extendOptions ( config . font , options . font ) ;
34+ extendOptions ( config . css , options . css ) ;
3235
3336 new Task ( 'fonts' , function ( ) {
3437 return gulp . src ( src )
0 commit comments