Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d52b521
Showing
5 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014 Karl Bowden | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# gulp-fontgen | ||
|
||
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency Status][depstat-image]][depstat-url] | ||
|
||
> gulp-fontgen plugin for [gulp](https://github.com/wearefractal/gulp) | ||
## Usage | ||
|
||
First, install `gulp-fontgen` as a development dependency: | ||
|
||
```shell | ||
npm install --save-dev gulp-fontgen | ||
``` | ||
|
||
Then, add it to your `gulpfile.js`: | ||
|
||
```javascript | ||
var gulp-fontgen = require("gulp-fontgen"); | ||
|
||
gulp.src("./src/*.ext") | ||
.pipe(gulp-fontgen({ | ||
dest: "./dest/" | ||
})) | ||
``` | ||
|
||
## API | ||
|
||
### gulp-fontgen(options) | ||
|
||
#### options.dest | ||
Type: `String` (Required) | ||
|
||
Destination to write all the font files to | ||
|
||
All other options for `fontfacegen` are passed through. | ||
|
||
## License | ||
|
||
[MIT License](http://en.wikipedia.org/wiki/MIT_License) | ||
|
||
[npm-url]: https://npmjs.org/package/gulp-fontgen | ||
[npm-image]: https://badge.fury.io/js/gulp-fontgen.png | ||
|
||
[travis-url]: http://travis-ci.org/agentk/gulp-fontgen | ||
[travis-image]: https://secure.travis-ci.org/agentk/gulp-fontgen.png?branch=master | ||
|
||
[coveralls-url]: https://coveralls.io/r/agentk/gulp-fontgen | ||
[coveralls-image]: https://coveralls.io/repos/agentk/gulp-fontgen/badge.png | ||
|
||
[depstat-url]: https://david-dm.org/agentk/gulp-fontgen | ||
[depstat-image]: https://david-dm.org/agentk/gulp-fontgen.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// through2 is a thin wrapper around node transform streams | ||
var through = require('through2'); | ||
var gutil = require('gulp-util'); | ||
var fontface = require('fontfacegen'); | ||
var path = require('path'); | ||
var PluginError = gutil.PluginError; | ||
|
||
// Consts | ||
const PLUGIN_NAME = 'gulp-fontgen'; | ||
|
||
// Plugin level function(dealing with files) | ||
function gulpFontgen(options) { | ||
|
||
if (!options.dest) { | ||
throw new PluginError(PLUGIN_NAME, "options.dest is missing"); | ||
} | ||
|
||
// Creating a stream through which each file will pass | ||
var stream = through.obj(function(file, enc, callback) { | ||
|
||
options.source = path.join(file.cwd, file.relative); | ||
fontface(options); | ||
|
||
this.push(file); | ||
return callback(); | ||
|
||
}); | ||
|
||
return stream; | ||
}; | ||
|
||
module.exports = gulpFontgen; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "gulp-fontgen", | ||
"description": "Generator of browser fonts and css from ttf or otf files", | ||
"version": "0.1.0", | ||
"homepage": "https://github.com/agentk/gulp-fontgen", | ||
"author": { | ||
"name": "Karl Bowden", | ||
"email": "karlbowden@gmail.com", | ||
"url": "http://karlbowden.com/" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/agentk/gulp-fontgen.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/agentk/gulp-fontgen/issues" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://github.com/agentk/grunt-fontgen/blob/master/LICENSE-MIT" | ||
} | ||
], | ||
"engines": { | ||
"node": ">= 0.8.0" | ||
}, | ||
"scripts": { | ||
"test": "node test.js" | ||
}, | ||
"main": "gulp-fontgen.js", | ||
"keywords": [ | ||
"font-face", | ||
"fontface", | ||
"font", | ||
"face", | ||
"web-fonts", | ||
"webfonts", | ||
"web", | ||
"ttf", | ||
"otf", | ||
"svg", | ||
"eot", | ||
"css" | ||
], | ||
"dependencies": { | ||
"fontfacegen": "^0.1.0", | ||
"through2": "^0.4.1", | ||
"gulp-util": "^2.2.14" | ||
} | ||
} |