Convert OpenType font to TryeType format with FontForge.
- CLI support,
- Gulp support,
- Additional font data in file stream
otf2ttf
depends on FontForge. Before using this module you need to install it.
Install the module as CLI tool
$ [sudo] npm install -g otf2ttf
If you are using otf2ttf
programatically you should install it as project dependency:
$ cd /path/to/your/project
$ npm install [--save||--save-dev] otf2ttf
$ otf2ttf <files> [<destination-path>]
files
- file path or comma separated string file pathsdestination-path
- string destination path, current directory is default
$ otf2ttf "/absolute/path/to/open-type-font.otf"
$ otf2ttf "../relative/path/to/open-type-font.otf"
$ otf2ttf "~/with-home-dir/path/to/open-type-font.otf"
$ otf2ttf "open-type-font.otf, another-open-type-font.otf"
$ otf2ttf open-type-font.otf ../dest/fonts
var gulp = require('gulp')
, otf2ttf = require('otf2ttf')
;
gulp.task('otf2ttf', [], function () {
return gulp.src("**/*.otf")
.pipe(otf2ttf())
.pipe(gulp.dest(function(file){
return "build/" + file.data.fontName
}));
});
default: false