Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

21
static/js/ketcher2/node_modules/gulp-iconfont/LICENCE generated vendored Executable file
View File

@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2013 Nicolas Froidure, <http://insertafter.com/>
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.

211
static/js/ketcher2/node_modules/gulp-iconfont/README.md generated vendored Normal file
View File

@ -0,0 +1,211 @@
# gulp-iconfont
> Create SVG/TTF/EOT/WOFF/WOFF2 fonts from several SVG icons with [Gulp](http://gulpjs.com/).
[![NPM version](https://badge.fury.io/js/gulp-iconfont.svg)](https://npmjs.org/package/gulp-iconfont) [![Build status](https://secure.travis-ci.org/nfroidure/gulp-iconfont.svg)](https://travis-ci.org/nfroidure/gulp-iconfont) [![Dependency Status](https://david-dm.org/nfroidure/gulp-iconfont.svg)](https://david-dm.org/nfroidure/gulp-iconfont) [![devDependency Status](https://david-dm.org/nfroidure/gulp-iconfont/dev-status.svg)](https://david-dm.org/nfroidure/gulp-iconfont#info=devDependencies) [![Coverage Status](https://coveralls.io/repos/nfroidure/gulp-iconfont/badge.svg?branch=master)](https://coveralls.io/r/nfroidure/gulp-iconfont?branch=master) [![Code Climate](https://codeclimate.com/github/nfroidure/gulp-iconfont.svg)](https://codeclimate.com/github/nfroidure/gulp-iconfont)
You can test this library with the
[frontend generator](http://nfroidure.github.io/svgiconfont/).
**Warning:** While this plugin may still be useful for fonts generation or old browser
support, you should consider using SVG icons directly. Indeed, when i created
`gulp-iconfont` and all its related modules, using SVG icons was just not realistic
for a wide browser suppport but i was already conviced that SVG was the
future, that's why i wanted my SVG source files to sit separated in a folder.
So, now, just enjoy switching to SVG with almost no effort :). Was a great
open source journey with you all!
[More info on with using SVG over icon fonts](https://sarasoueidan.com/blog/icon-fonts-to-svg/).
## Usage
First, install `gulp-iconfont` as a development dependency:
```shell
npm install --save-dev gulp-iconfont
```
Then, add it to your `gulpfile.js`:
```javascript
var iconfont = require('gulp-iconfont');
var runTimestamp = Math.round(Date.now()/1000);
gulp.task('Iconfont', function(){
return gulp.src(['assets/icons/*.svg'])
.pipe(iconfont({
fontName: 'myfont', // required
prependUnicode: true, // recommended option
formats: ['ttf', 'eot', 'woff'], // default, 'woff2' and 'svg' are available
timestamp: runTimestamp, // recommended to get consistent builds when watching files
}))
.on('glyphs', function(glyphs, options) {
// CSS templating, e.g.
console.log(glyphs, options);
})
.pipe(gulp.dest('www/fonts/'));
});
```
`gulp-iconfont` bundles several plugins to bring a simpler API
(`gulp-svgicons2svgfont`, `gulp-svg2tff`, `gulp-ttf2eot`, `gulp-ttf2woff`)
for more flexibility, feel free to use them separately.
**If some font glyphs aren't converted properly** you should add the
`normalize:true` option and a `fontHeight` greater than 1000
(`fontHeight: 1001`).
### Make your CSS
To use this font in your CSS, you could add a mixin like in this
[real world example](https://github.com/ChtiJS/chtijs.francejs.org/blob/master/documents/less/_icons.less).
You can also generate your CSS automatically with
[`gulp-iconfont-css`](https://github.com/backflip/gulp-iconfont-css).
It's also easy to make a CSS template by yourself. Like
[this example](https://github.com/cognitom/symbols-for-sketch/blob/master/gulpfile.js#L17),
`gulp-consolidate` is useful to handling
[such a template](https://github.com/cognitom/symbols-for-sketch/blob/master/templates/fontawesome-style.css). The template is outdated, **change** every occurrence of `glyph.codepoint.toString(16).toUpperCase()` to `glyph.unicode[0].charCodeAt(0).toString(16).toUpperCase()`, otherwise it will not work.
```javascript
var async = require('async');
var gulp = require('gulp');
var iconfont = require('gulp-iconfont');
var consolidate = require('gulp-consolidate');
gulp.task('Iconfont', function(done){
var iconStream = gulp.src(['assets/icons/*.svg'])
.pipe(iconfont({ fontName: 'myfont' }));
async.parallel([
function handleGlyphs (cb) {
iconStream.on('glyphs', function(glyphs, options) {
gulp.src('templates/myfont.css')
.pipe(consolidate('lodash', {
glyphs: glyphs,
fontName: 'myfont',
fontPath: '../fonts/',
className: 's'
}))
.pipe(gulp.dest('www/css/'))
.on('finish', cb);
});
},
function handleFonts (cb) {
iconStream
.pipe(gulp.dest('www/fonts/'))
.on('finish', cb);
}
], done);
});
```
## Issues
Add issues to the right repos:
* the plugin doesn't work at all, submit your issue in this repo.
* every font doesn't display as expected: submit the issue to the
[svgicons2svgfont](https://github.com/nfroidure/svgicons2svgfont) repository.
* only some fonts are damaged? Please look at the font format the targeted
browser actually use and then, submit your issue to one of those projects:
[svg2ttf](https://github.com/fontello/svg2ttf),
[ttf2eot](https://github.com/fontello/ttf2eot),
[ttf2woff](https://github.com/fontello/ttf2woff).
## API
### iconfont(options)
#### options.formats
Type: `Array`
Default value: `['ttf', 'eot', 'woff']`
Possible values: `['svg', 'ttf', 'eot', 'woff', 'woff2']`
Since SVG fonts are deprecated in some (every ?) browsers, they are disabled
per default.
Also the WOFF2 fonts are disabled since it seems to cause issues on some setup
(see https://github.com/nfroidure/gulp-iconfont/issues/64).
#### options.autohint
Type: `Boolean|String`
Default value: `false`
If [ttfautohint](http://www.freetype.org/ttfautohint/) is installed on your
system, you may want to auto hint your fonts. Beware that this is an
experimental and untested feature (beware to use at least the 0.93 version).
If the value is a string, it is taken to be the path to the `ttfautohint` binary.
Otherwise, `ttfautohint` is searched in $PATH.
#### options.*
The [svgicons2svgfont](https://github.com/nfroidure/svgicons2svgfont#svgicons2svgfontoptions)
are available:
* options.fontName (required)
* options.fontWeight
* options.fontStyle
* options.fixedWidth
* options.centerHorizontally
* options.normalize
* options.fontHeight
* options.round
* options.descent
* options.metadata
* options.log
So are the [gulp-svgicons2svgfont](https://github.com/nfroidure/gulp-svgicons2svgfont#svgicons2svgfontoptions):
* options.startUnicode
* options.prependUnicode
And the [gulp-svg2ttf](https://github.com/nfroidure/gulp-svg2ttf#svg2ttfoptions):
* options.timestamp
## Preparing SVG's
Beware that your SVG icons must have a high enough height. **500 is a minimum**. If
you do not want to resize them, you can try to combine the `fontHeight` and
the `normalize` option to get them in a correct size.
### Inkscape
Degroup every shapes (Ctrl+Shift+G), convert to pathes (Ctrl+Maj+C) and merge
them (Ctrl++). Then save your SVG, prefer 'simple SVG' file type.
### Illustrator
Save your file as SVG with the following settings:
- SVG Profiles: SVG 1.1
- Fonts Type: SVG
- Fonts Subsetting: None
- Options Image Location: Embed
- Advanced Options
- CSS Properties: Presentation Attributes
- Decimal Places: 1
- Encoding: UTF-8
- Output fewer <tspan> elements: check
Leave the rest unchecked.
More in-depth information: [http://www.adobe.com/inspire/2013/09/exporting-svg-illustrator.html](http://www.adobe.com/inspire/2013/09/exporting-svg-illustrator.html)
### Sketch
[Sketch](http://bohemiancoding.com/sketch/) is a relatively new drawing tool on
Mac. With help of [Sketch Tools](http://bohemiancoding.com/sketch/tool/) and
[gulp-sketch](https://github.com/cognitom/gulp-sketch), you can directly create
fonts from your Sketch file. No need to export intermediate SVGs.
![Directly create fonts from your Sketch file](https://github.com/cognitom/symbols-for-sketch/raw/master/images/webfonts.png)
Here is a sample repo "[Symbols for Sketch](https://github.com/cognitom/symbols-for-sketch)".
0. [Download the zipped repo](https://github.com/cognitom/symbols-for-sketch/archive/master.zip) and extract it.
0. Go to the directory. `$ cd path/to/dir`
0. Install some tools. `$ npm install`
0. Create fonts and CSS `$ gulp symbols`
## Contributing
Feel free to push your code if you agree with publishing under the MIT license.
## Stats
[![NPM](https://nodei.co/npm/gulp-iconfont.png?downloads=true&stars=true)](https://nodei.co/npm/gulp-iconfont/)
[![NPM](https://nodei.co/npm-dl/gulp-iconfont.png)](https://nodei.co/npm/gulp-iconfont/)

View File

@ -0,0 +1,85 @@
{
"_from": "gulp-iconfont@8.0.1",
"_id": "gulp-iconfont@8.0.1",
"_inBundle": false,
"_integrity": "sha1-vDKqbj6lyjifuwFLqNLAjww8B2M=",
"_location": "/gulp-iconfont",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "gulp-iconfont@8.0.1",
"name": "gulp-iconfont",
"escapedName": "gulp-iconfont",
"rawSpec": "8.0.1",
"saveSpec": null,
"fetchSpec": "8.0.1"
},
"_requiredBy": [
"#DEV:/"
],
"_resolved": "https://registry.npmjs.org/gulp-iconfont/-/gulp-iconfont-8.0.1.tgz",
"_shasum": "bc32aa6e3ea5ca389fbb014ba8d2c08f0c3c0763",
"_spec": "gulp-iconfont@8.0.1",
"_where": "/home/manfred/enviPath/ketcher2/ketcher",
"author": {
"name": "Nicolas Froidure",
"url": "http://www.insertafter.com/blog.html"
},
"bugs": {
"url": "https://github.com/nfroidure/gulp-iconfont/issues"
},
"bundleDependencies": false,
"dependencies": {
"gulp-cond": "^1.0.0",
"gulp-spawn": "^0.3.0",
"gulp-svg2ttf": "^2.0.0",
"gulp-svgicons2svgfont": "^3.0.1",
"gulp-ttf2eot": "^1.1.1",
"gulp-ttf2woff": "^1.1.0",
"gulp-ttf2woff2": "^2.0.2",
"gulp-util": "^3.0.7",
"plexer": "^1.0.1",
"streamfilter": "^1.0.5"
},
"deprecated": false,
"description": "Create icon fonts from several SVG icons",
"devDependencies": {
"coveralls": "^2.11.6",
"eslint": "^1.10.1",
"eslint-config-simplifield": "^1.2.2",
"gulp": "^3.9.1",
"istanbul": "^0.4.2",
"mocha": "^2.4.5",
"mocha-lcov-reporter": "^1.0.0",
"neatequal": "^1.0.0",
"streamtest": "^1.2.1"
},
"engines": {
"node": ">= 4"
},
"homepage": "https://github.com/nfroidure/gulp-iconfont",
"keywords": [
"gulpplugin",
"gulp",
"icon",
"font"
],
"license": "MIT",
"main": "src/index.js",
"name": "gulp-iconfont",
"repository": {
"type": "git",
"url": "git://github.com/nfroidure/gulp-iconfont.git"
},
"scripts": {
"cli": "env NPM_RUN_CLI=1",
"cover": "istanbul cover --report html _mocha -- tests/*.mocha.js -R spec -t 5000",
"coveralls": "istanbul cover _mocha --report lcovonly -- tests/*.mocha.js -R spec -t 5000 && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",
"generate-fixtures": "./tests/generate-fixtures.sh",
"lint": "eslint src/*.js tests/*.js",
"preversion": "npm run lint && npm test",
"test": "mocha tests/*.mocha.js"
},
"version": "8.0.1"
}

View File

@ -0,0 +1,106 @@
'use strict';
var duplexer = require('plexer');
var svgicons2svgfont = require('gulp-svgicons2svgfont');
var svg2ttf = require('gulp-svg2ttf');
var ttf2eot = require('gulp-ttf2eot');
var ttf2woff = require('gulp-ttf2woff');
var ttf2woff2 = require('gulp-ttf2woff2');
var cond = require('gulp-cond');
var filter = require('streamfilter');
var spawn = require('gulp-spawn');
function gulpFontIcon(options) {
var inStream = null;
var outStream = null;
var duplexStream = null;
options = options || {};
options.formats = options.formats || ['ttf', 'eot', 'woff'];
// Generating SVG font and saving her
inStream = svgicons2svgfont(options);
// Generating TTF font and saving her
outStream = inStream
.pipe(svg2ttf({
clone: -1 !== options.formats.indexOf('svg'),
timestamp: options.timestamp,
}).on('error', function(err) {
outStream.emit('error', err);
}))
// TTFAutoHint
.pipe(cond(!!options.autohint, function() {
var hintPath = typeof options.autohint === 'string' ? options.autohint : 'ttfautohint';
var nonTTFfilter = filter(function(file, unused, cb) {
cb(file.path.indexOf('.ttf') !== file.path.length - 4);
}, {
objectMode: true,
restore: true,
passthrough: true,
});
return duplexer(
{ objectMode: true },
nonTTFfilter,
nonTTFfilter.pipe(spawn({
cmd: '/bin/sh',
args: [
'-c',
'cat | "'+hintPath+'" --symbol --fallback-script=latn' +
' --windows-compatibility --no-info /dev/stdin /dev/stdout | cat',
],
})).pipe(nonTTFfilter.restore)
).on('error', function(err) {
outStream.emit('error', err);
});
}))
// Generating EOT font
.pipe(cond(
-1 !== options.formats.indexOf('eot'),
function() {
return ttf2eot({ clone: true }).on('error', function(err) {
outStream.emit('error', err);
});
}
))
// Generating WOFF font
.pipe(cond(
-1 !== options.formats.indexOf('woff'),
function() {
return ttf2woff({ clone: true }).on('error', function(err) {
outStream.emit('error', err);
});
}
))
// Generating WOFF2 font
.pipe(cond(
-1 !== options.formats.indexOf('woff2'),
function() {
return ttf2woff2({ clone: true }).on('error', function(err) {
outStream.emit('error', err);
});
}
))
// Filter TTF font if necessary
.pipe(cond(
-1 === options.formats.indexOf('ttf'),
function() {
return filter(function(file, unused, cb) {
cb(file.path.indexOf('.ttf') === file.path.length - 4);
}, {
objectMode: true,
passthrough: true,
});
}
));
duplexStream = duplexer({ objectMode: true }, inStream, outStream);
// Re-emit codepoint mapping event
inStream.on('glyphs', function(glyphs) {
duplexStream.emit('glyphs', glyphs, options);
});
return duplexStream;
}
module.exports = gulpFontIcon;

View File

@ -0,0 +1,28 @@
[{
"name": "space",
"unicode": [" "]
},{
"name": "github",
"unicode": ["\uE001"]
},{
"name": "arrow-down",
"unicode": ["\uE002"]
},{
"name": "arrow-left",
"unicode": ["\uE003"]
},{
"name": "arrow-right",
"unicode": ["\uE004"]
},{
"name": "arrow-up",
"unicode": ["\uE005"]
},{
"name": "google",
"unicode": ["\uE006"]
},{
"name": "remove",
"unicode": ["\uE007"]
},{
"name": "twitter",
"unicode": ["\uE008"]
}]

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
x="0"
y="0"
width="50"
height="150"
viewBox="0 0 150 150">
</svg>

After

Width:  |  Height:  |  Size: 238 B

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="150"
id="svg3296"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="github.svg">
<defs
id="defs3298" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.35"
inkscape:cx="-251.39497"
inkscape:cy="-77.110259"
inkscape:document-units="px"
inkscape:current-layer="svg3296"
showgrid="false"
inkscape:window-width="1280"
inkscape:window-height="937"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata3301">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<path
id="path3075"
d="m 75,30 c -33.13712,0 -60,26.8632 -60,60 0,33.1368 26.86288,60 60,60 33.13712,0 60,-26.8632 60,-60 0,-33.1368 -26.86288,-60 -60,-60 z m 0,8 c 28.7188,0 52,23.2808 52,52 0,21.8192 -13.44816,40.5336 -32.5,48.2496 L 87,102 C 99.01944,96.128 109.0096,89.312 109,78.2496 108.936,62.716 90.9528,55.2576 75,54 55.73992,54.128 39.07864,64.6832 39,78 c -0.288,8.6816 8.21536,21.1896 24,24 l -8,36 C 36.22128,130.1576 23,111.6224 23,90 23,61.2808 46.2812,38 75,38 z"
style="fill:#000000;fill-rule:evenodd;stroke:none"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="100"
height="150"
viewBox="0 0 100 150"
id="svg2"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="uE002-arrow-down.svg">
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs6" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="861"
inkscape:window-height="607"
id="namedview4"
showgrid="false"
inkscape:zoom="1.5733333"
inkscape:cx="74.999998"
inkscape:cy="74.999998"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<path
d="M 50,140 95,90 5,90 z"
id="path2986"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="80"
height="150"
viewBox="0 0 80 150"
id="svg2">
<path
d="M 5,87 75,24 75,150 z"
id="path2986" />
</svg>

After

Width:  |  Height:  |  Size: 294 B

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
x="0px"
y="0px"
width="80"
height="150"
viewBox="0 0 80 150"
id="svg2"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="uE004-arrow-right.svg">
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs6" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="999"
inkscape:window-height="671"
id="namedview4"
showgrid="false"
inkscape:zoom="1.5733333"
inkscape:cx="74.999992"
inkscape:cy="74.999992"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="0"
inkscape:current-layer="svg2"
showguides="true"
inkscape:guide-bbox="true" />
<path
id="path2986"
d="M 75,87 5,24 5,150 z"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="100"
height="150"
viewBox="0 0 100 150"
id="svg2"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="uE005-arrow-up.svg">
<metadata
id="metadata3001">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs2999" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="640"
inkscape:window-height="480"
id="namedview2997"
showgrid="false"
inkscape:zoom="1.5733333"
inkscape:cx="74.999998"
inkscape:cy="74.999998"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<path
d="m 50,90 45,50 -90,0 z"
id="path2986"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="150"
id="svg3296"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="google.svg">
<defs
id="defs3298" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.98994949"
inkscape:cx="-21.821455"
inkscape:cy="81.348923"
inkscape:document-units="px"
inkscape:current-layer="svg3296"
showgrid="false"
inkscape:window-width="1073"
inkscape:window-height="625"
inkscape:window-x="3"
inkscape:window-y="129"
inkscape:window-maximized="0"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata3301">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<path
inkscape:connector-curvature="0"
id="path2987"
style="font-size:165.16976929px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Gentium Book Basic;-inkscape-font-specification:Gentium Book Basic"
d="m 87.999996,59.62961 c -5.4e-5,-2.853171 -0.421532,-5.541784 -1.264438,-8.065845 -0.84301,-2.578814 -2.107447,-4.828469 -3.793312,-6.748971 -1.685965,-1.920373 -3.767017,-3.429288 -6.243162,-4.526749 -2.476231,-1.097324 -5.347556,-1.646021 -8.613982,-1.646091 -1.317155,7e-5 -2.739646,0.356723 -4.267477,1.069959 -1.527891,0.658505 -2.950382,1.673593 -4.267479,3.045268 -1.317146,1.316938 -2.423528,2.990461 -3.319148,5.020577 -0.84298,1.975367 -1.264459,4.307326 -1.264438,6.995884 -2.1e-5,2.853276 0.395116,5.569322 1.18541,8.148149 0.790251,2.524049 2.002003,4.746269 3.635259,6.666667 1.633205,1.865607 3.687914,3.347087 6.164134,4.444445 2.528841,1.097427 5.505536,1.646123 8.930092,1.646091 1.52782,3.2e-5 3.05568,-0.329185 4.583586,-0.987655 1.5805,-0.658401 3.002991,-1.646055 4.267478,-2.962963 1.264386,-1.371704 2.291741,-3.045227 3.082066,-5.020576 0.790221,-2.030135 1.185357,-4.389528 1.185411,-7.07819 M 75.987837,110.4115 c -2.212805,-0.27435 -4.267515,-0.57613 -6.164133,-0.90535 -1.844006,-0.32921 -3.608949,-0.68586 -5.294834,-1.06995 -3.266491,1.9753 -5.848049,3.75856 -7.744681,5.3498 -1.896678,1.64608 -3.345511,3.10012 -4.346505,4.36213 -0.948345,1.31687 -1.554221,2.46913 -1.817629,3.45679 -0.26344,1.04251 -0.395153,2.00273 -0.395136,2.88067 -1.7e-5,2.13989 0.684886,4.17007 2.054711,6.09052 1.422473,1.92042 3.345469,3.59395 5.768997,5.02058 2.423479,1.42658 5.242119,2.55141 8.455927,3.37449 3.213744,0.87788 6.611917,1.31684 10.19453,1.31687 3.371788,-3e-5 6.401167,-0.46642 9.088147,-1.39918 2.739559,-0.93281 5.031351,-2.19481 6.87538,-3.786 1.843911,-1.59125 3.266402,-3.48425 4.267477,-5.67902 1.000949,-2.1948 1.501452,-4.5542 1.501521,-7.07819 -6.9e-5,-1.37175 -0.316171,-2.66119 -0.94833,-3.86831 -0.632281,-1.20714 -1.791349,-2.33196 -3.477203,-3.37448 -1.633291,-0.98766 -3.898739,-1.89301 -6.796353,-2.71605 -2.89772,-0.76818 -6.638345,-1.42661 -11.221886,-1.97532 M 101.43465,56.255124 c -7e-5,4.225015 -0.92205,8.093324 -2.765957,11.604939 -1.791353,3.456828 -4.162171,6.447223 -7.112465,8.971194 -2.95041,2.469165 -6.348583,4.417037 -10.19453,5.843621 -3.846041,1.371768 -7.771063,2.057638 -11.775076,2.057614 l -0.474165,0 c -2.318168,2.08507 -3.898714,3.813464 -4.741641,5.185185 -0.790303,1.37176 -1.185439,2.22224 -1.185411,2.551441 -2.8e-5,0.603582 0.237053,1.207149 0.711247,1.8107 0.474134,0.548711 1.396118,1.097407 2.765958,1.64609 1.422457,0.548709 3.39814,1.097406 5.927051,1.646091 2.581519,0.493837 5.927007,1.0151 10.036474,1.563786 5.900655,0.713315 10.774005,1.728405 14.620062,3.045265 3.845923,1.26201 6.901653,2.74349 9.167173,4.44445 2.26538,1.64608 3.84592,3.48422 4.74165,5.5144 0.89556,2.03017 1.34337,4.14265 1.34345,6.33745 -8e-5,2.85321 -0.55326,5.62413 -1.65957,8.31276 -1.10646,2.68859 -2.63432,5.18516 -4.58358,7.48971 -1.94941,2.35937 -4.24121,4.49928 -6.875384,6.41976 -2.581624,1.9204 -5.37392,3.56649 -8.376901,4.93827 -3.003093,1.3717 -6.137842,2.44165 -9.404254,3.20987 -3.266509,0.76814 -6.480285,1.15223 -9.641339,1.15227 -2.581595,-4e-5 -5.268523,-0.19209 -8.06079,-0.57614 -2.739643,-0.32925 -5.452913,-0.87795 -8.139818,-1.64608 -2.634265,-0.76822 -5.163138,-1.75588 -7.586627,-2.96297 -2.370832,-1.1523 -4.478227,-2.57891 -6.322189,-4.27984 -1.791292,-1.64612 -3.213784,-3.53912 -4.267477,-5.67901 -1.053701,-2.08507 -1.580549,-4.4719 -1.580547,-7.16049 -2e-6,-1.42663 0.263422,-2.90812 0.790274,-4.44444 0.526845,-1.4815 1.527857,-3.10016 3.003039,-4.85597 1.527855,-1.70097 3.635249,-3.56654 6.322189,-5.59672 2.686915,-2.03018 6.2168,-4.27983 10.589666,-6.74897 -3.266484,-1.262 -5.610959,-2.63373 -7.033435,-4.11522 -1.369822,-1.53634 -2.054725,-3.100128 -2.054711,-4.691359 -1.4e-5,-0.493815 0.158041,-1.152251 0.474164,-1.97531 0.368779,-0.82303 1.000998,-1.810683 1.896656,-2.962962 0.948311,-1.152246 2.212748,-2.441683 3.793313,-3.868314 1.633211,-1.481458 3.687921,-3.127548 6.164135,-4.938272 -2.739639,-0.823018 -5.242169,-1.947846 -7.5076,-3.374485 -2.265467,-1.481451 -4.214806,-3.237279 -5.848024,-5.26749 -1.580558,-2.085011 -2.818653,-4.416972 -3.714286,-6.995885 -0.895652,-2.578831 -1.343473,-5.377183 -1.343465,-8.395063 -8e-6,-4.005433 0.895635,-7.791438 2.68693,-11.358024 1.791275,-3.621335 4.162093,-6.748905 7.112462,-9.382718 2.950335,-2.688541 6.322165,-4.801022 10.115503,-6.337448 3.845966,-1.591143 7.823673,-2.386752 11.933131,-2.386832 3.319106,8e-5 6.40117,0.493906 9.2462,1.481482 2.897619,0.932861 5.531861,2.249733 7.902737,3.950617 5.215744,-0.603492 9.562248,-1.453971 13.039508,-2.55144 3.52982,-1.097316 6.40115,-2.057535 8.61399,-2.880659 L 114,32.633723 c -0.57962,1.426687 -1.21183,2.880733 -1.89666,4.36214 -0.6323,1.481553 -1.5016,2.908163 -2.6079,4.279836 -1.89673,0.329286 -3.81973,0.631069 -5.769,0.90535 -1.89672,0.219545 -4.030461,0.384155 -6.401215,0.493827 1.31706,1.975373 2.318066,4.115289 3.003035,6.419753 0.73753,2.304585 1.10632,4.691415 1.10639,7.160495" />
</svg>

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="150"
height="150"
viewBox="0 0 150 150"
id="svg2">
<path
d="M 111.78099,9.999995 74.988545,46.792437 38.219019,10.022911 10.000009,38.241921 46.769534,75.011447 10,111.78098 38.219009,140 74.988543,103.23047 111.75808,140 139.97709,111.78099 103.20755,75.011455 140,38.219009 111.781,9.9999991 z"
id="rect2986"/>
</svg>

After

Width:  |  Height:  |  Size: 508 B

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="150"
height="150"
id="svg3296"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="twitter.svg">
<defs
id="defs3298" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="91.156323"
inkscape:cy="136.66042"
inkscape:document-units="px"
inkscape:current-layer="svg3296"
showgrid="false"
inkscape:window-width="1012"
inkscape:window-height="617"
inkscape:window-x="3"
inkscape:window-y="129"
inkscape:window-maximized="0"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata3301">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<path
style="fill:#000000;fill-opacity:1;stroke:none"
d="m 30,39.13301 0,80.90438 c 0.82021,8.58065 -0.43394,25.71266 24.31667,29.21559 L 114.00297,150 c 5.04305,-4.74459 5.12775,-9.48817 5.15805,-14.23277 -0.48061,-6.45163 -1.2181,-12.6933 -5.89495,-15.73186 l -48.63332,-0.74702 c -7.89709,-1.59196 -10.83631,-5.42499 -11.05299,-10.48756 l 0,-20.22611 60.51873,0.61579 c 3.56749,-4.74156 6.49142,-8.37572 5.79941,-14.84957 -0.37237,-9.85259 -2.99503,-12.83967 -5.89493,-14.98281 L 55.05355,58.61108 54.31675,39.13401 C 52.29781,35.57153 51.51267,31.25597 45.47434,30.14452 37.87803,29.17541 33.34029,33.18105 30.0001,39.13401 L 30,39.13201 z"
id="path4124"
sodipodi:nodetypes="ccccccccccccccccc"
inkscape:connector-curvature="0" />
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,13 @@
#!/bin/bash
mkdir -p tests/expected/hinted \
&& ./node_modules/svgicons2svgfont/bin/svgicons2svgfont.js -f iconsfont tests/fixtures/iconsfont/* > tests/expected/iconsfont.svg \
&& ./node_modules/svg2ttf/svg2ttf.js --ts 3 tests/expected/iconsfont.svg tests/expected/iconsfont.ttf \
&& ( \
cat tests/expected/iconsfont.ttf \
| ./tests/ttfautohint/ttfautohint.sh --symbol --fallback-script=latn --windows-compatibility --no-info \
> tests/expected/hinted/iconsfont.ttf\
) \
&& ./node_modules/ttf2eot/ttf2eot.js tests/expected/iconsfont.ttf tests/expected/iconsfont.eot \
&& ./node_modules/ttf2woff/ttf2woff.js tests/expected/iconsfont.ttf tests/expected/iconsfont.woff \
&& (cat tests/expected/iconsfont.ttf | node ./node_modules/ttf2woff2/bin/ttf2woff2.js > tests/expected/iconsfont.woff2)

View File

@ -0,0 +1,304 @@
/* eslint max-nested-callbacks:[1] */
'use strict';
var fs = require('fs');
var path = require('path');
var gulp = require('gulp');
var iconfont = require('../src/index');
var assert = require('assert');
var neatequal = require('neatequal');
var streamtest = require('streamtest');
describe('gulp-iconfont', function() {
var generationTimestamp = 3;
streamtest.versions.forEach(function(version) {
describe('for ' + version + ' streams', function() {
describe('in stream mode', function() {
it('should work', function(done) {
var contents = [];
var processedFiles = 0;
gulp.src(path.join(__dirname, 'fixtures', 'iconsfont', '*.svg'), { buffer: false })
.pipe(iconfont({
fontName: 'iconsfont',
timestamp: generationTimestamp,
}))
.pipe(streamtest[version].toObjects(function(err, files) {
if(err) {
return done(err);
}
assert.equal(files.length, 3);
files.forEach(function(file, index) {
file.contents.pipe(streamtest[version].toChunks(function(err2, chunks) {
if(err2) {
return done(err2);
}
contents[index] = Buffer.concat(chunks);
processedFiles++;
if(processedFiles === files.length) {
assert.deepEqual(
contents[0],
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.ttf'))
);
assert.deepEqual(
contents[1],
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.woff'))
);
assert.deepEqual(
contents[2],
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.eot'))
);
return done();
}
}));
});
}));
});
it('should work for only one font', function(done) {
var contents = [];
var processedFiles = 0;
gulp.src(path.join(__dirname, 'fixtures', 'iconsfont', '*.svg'), { buffer: false })
.pipe(iconfont({
fontName: 'iconsfont',
timestamp: generationTimestamp,
formats: ['woff'],
}))
.pipe(streamtest[version].toObjects(function(err, files) {
if(err) {
return done(err);
}
assert.equal(files.length, 1);
files.forEach(function(file, index) {
file.contents.pipe(streamtest[version].toChunks(function(err2, chunks) {
if(err2) {
return done(err2);
}
contents[index] = Buffer.concat(chunks);
processedFiles++;
if(processedFiles === files.length) {
assert.deepEqual(
contents[0],
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.woff'))
);
return done();
}
}));
});
}));
});
it('should output SVG font with svg added to formats', function(done) {
var contents = [];
var processedFiles = 0;
this.timeout(5000);
gulp.src(path.join(__dirname, 'fixtures', 'iconsfont', '*.svg'), { buffer: false })
.pipe(iconfont({
fontName: 'iconsfont',
formats: [
'svg',
'ttf',
'eot',
'woff',
],
timestamp: generationTimestamp,
}))
.pipe(streamtest[version].toObjects(function(err, files) {
if(err) {
return done(err);
}
assert.equal(files.length, 4);
files.forEach(function(file, index) {
file.contents.pipe(streamtest[version].toChunks(function(err2, chunks) {
if(err2) {
return done(err2);
}
contents[index] = Buffer.concat(chunks);
processedFiles++;
if(processedFiles === files.length) {
assert.deepEqual(
contents[0],
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.svg'))
);
assert.deepEqual(
contents[1],
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.ttf'))
);
assert.deepEqual(
contents[2],
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.woff'))
);
assert.deepEqual(
contents[3],
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.eot'))
);
return done();
}
}));
});
}));
});
it('should output WOFF2 font with woff2 added to formats', function(done) {
var contents = [];
var processedFiles = 0;
this.timeout(5000);
gulp.src(path.join(__dirname, 'fixtures', 'iconsfont', '*.svg'), { buffer: false })
.pipe(iconfont({
fontName: 'iconsfont',
formats: [
'ttf',
'woff',
'woff2',
],
timestamp: generationTimestamp,
}))
.pipe(streamtest[version].toObjects(function(err, files) {
if(err) {
return done(err);
}
assert.equal(files.length, 3);
files.forEach(function(file, index) {
file.contents.pipe(streamtest[version].toChunks(function(err2, chunks) {
if(err2) {
return done(err2);
}
contents[index] = Buffer.concat(chunks);
processedFiles++;
if(processedFiles === files.length) {
assert.deepEqual(
contents[0],
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.ttf'))
);
assert.deepEqual(
contents[1],
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.woff2'))
);
assert.deepEqual(
contents[2],
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.woff'))
);
return done();
}
}));
});
}));
});
});
describe('in buffer mode', function() {
it('should work', function(done) {
gulp.src(path.join(__dirname, 'fixtures', 'iconsfont', '*.svg'), { buffer: true })
.pipe(iconfont({
fontName: 'iconsfont',
timestamp: generationTimestamp,
}))
.pipe(streamtest[version].toObjects(function(err, files) {
if(err) {
return done(err);
}
assert.equal(files.length, 3);
assert.deepEqual(
files[0].contents,
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.ttf'))
);
assert.deepEqual(
files[1].contents,
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.woff'))
);
assert.deepEqual(
files[2].contents,
fs.readFileSync(path.join(__dirname, 'expected', 'iconsfont.eot'))
);
done();
}));
});
it('should emit an event with the codepoint mapping', function(done) {
var codepoints;
gulp.src(path.join(__dirname, 'fixtures', 'iconsfont', '*.svg'), { buffer: true })
.pipe(iconfont({
fontName: 'iconsfont',
timestamp: generationTimestamp,
})).on('glyphs', function(_codepoints_) {
codepoints = _codepoints_;
})
.pipe(streamtest[version].toObjects(function(err, files) {
if(err) {
return done(err);
}
assert.equal(files.length, 3);
neatequal(codepoints,
JSON.parse(fs.readFileSync(
path.join(__dirname, 'expected', 'codepoints.json'), 'utf8'))
);
done();
}));
});
it('should work with autohinted iconsfont', function(done) {
gulp.src(path.join(__dirname, 'fixtures', 'iconsfont', '*.svg'), { buffer: true })
.pipe(iconfont({
fontName: 'iconsfont',
timestamp: generationTimestamp,
autohint: __dirname + '/ttfautohint/ttfautohint.sh',
formats: ['ttf']
}))
.pipe(streamtest[version].toObjects(function(err, files) {
assert.equal(files.length, 1);
if(err) {
return done(err);
}
var contents = files[0].contents;
var expected = fs.readFileSync(path.join(__dirname, 'expected', 'hinted', 'iconsfont.ttf'));
// Clear the flags that change between invocations
// Clear checksums
contents.writeUInt8(0, 0x0080);
expected.writeUInt8(0, 0x0080);
contents.writeUInt8(0, 0x0081);
expected.writeUInt8(0, 0x0081);
contents.writeUInt8(0, 0x0082);
expected.writeUInt8(0, 0x0082);
contents.writeUInt8(0, 0x0083);
expected.writeUInt8(0, 0x0083);
contents.writeUInt8(0, 0x714);
expected.writeUInt8(0, 0x714);
contents.writeUInt8(0, 0x715);
expected.writeUInt8(0, 0x715);
contents.writeUInt8(0, 0x716);
expected.writeUInt8(0, 0x716);
contents.writeUInt8(0, 0x717);
expected.writeUInt8(0, 0x717);
contents.writeUInt8(0, 0x72C);
expected.writeUInt8(0, 0x72C);
contents.writeUInt8(0, 0x72D);
expected.writeUInt8(0, 0x72D);
contents.writeUInt8(0, 0x72E);
expected.writeUInt8(0, 0x72E);
contents.writeUInt8(0, 0x72F);
expected.writeUInt8(0, 0x72F);
assert.deepEqual(
contents,
expected
);
done();
}));
});
});
});
});
});

View File

@ -0,0 +1,25 @@
FROM ubuntu:16.04
RUN apt-get update \
&& apt-get install -y wget build-essential pkg-config qt4-qmake libqt4-dev \
&& mkdir -p /ttfautohint && cd /ttfautohint
ENV FT_VERSION=2.6.3
ENV HB_VERSION=1.2.7
ENV TA_VERSION=1.5
RUN wget http://download.savannah.gnu.org/releases/freetype/freetype-"$FT_VERSION".tar.bz2 \
&& tar xjf freetype-"$FT_VERSION".tar.bz2 \
&& (cd freetype-"$FT_VERSION" && ./configure --without-harfbuzz && make install && make distclean) \
&& wget https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-"$HB_VERSION".tar.bz2 \
&& tar xjf harfbuzz-"$HB_VERSION".tar.bz2 \
&& (cd harfbuzz-"$HB_VERSION" && ./configure && make install) \
&& (cd freetype-"$FT_VERSION" && ./configure && make install) \
&& wget http://downloads.sourceforge.net/project/freetype/ttfautohint/"$TA_VERSION"/ttfautohint-"$TA_VERSION".tar.gz \
&& tar xzf ttfautohint-"$TA_VERSION".tar.gz \
&& (cd ttfautohint-"$TA_VERSION" && ./configure && make install)
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
ENTRYPOINT ["/usr/local/bin/ttfautohint"]
CMD ["/dev/stdin", "/dev/stdout"]

View File

@ -0,0 +1,7 @@
#!/bin/bash
DOCKER_IMAGE="ttfautohint:1.5"
if command -v docker >/dev/null 2>&1 && test ! -z "$(docker images -q "$DOCKER_IMAGE" 2> /dev/null)"; then
exec docker run --rm -a STDIN -a STDOUT -a STDERR -i "$DOCKER_IMAGE" "$@"
else
exec ttfautohint "$@"
fi