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-ttf2eot/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.

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

@ -0,0 +1,63 @@
# gulp-ttf2eot
> Create an EOT font from a TTF one with [Gulp](http://gulpjs.com/).
[![NPM version](https://badge.fury.io/js/gulp-ttf2eot.svg)](https://npmjs.org/package/gulp-ttf2eot) [![Build status](https://secure.travis-ci.org/nfroidure/gulp-ttf2eot.svg)](https://travis-ci.org/nfroidure/gulp-ttf2eot) [![Dependency Status](https://david-dm.org/nfroidure/gulp-ttf2eot.svg)](https://david-dm.org/nfroidure/gulp-ttf2eot) [![devDependency Status](https://david-dm.org/nfroidure/gulp-ttf2eot/dev-status.svg)](https://david-dm.org/nfroidure/gulp-ttf2eot#info=devDependencies) [![Coverage Status](https://coveralls.io/repos/nfroidure/gulp-ttf2eot/badge.svg?branch=master)](https://coveralls.io/r/nfroidure/gulp-ttf2eot?branch=master) [![Code Climate](https://codeclimate.com/github/nfroidure/gulp-ttf2eot.svg)](https://codeclimate.com/github/nfroidure/gulp-ttf2eot)
## Usage
First, install `gulp-ttf2eot` as a development dependency:
```shell
npm install --save-dev gulp-ttf2eot
```
Then, add it to your `gulpfile.js`:
```javascript
var ttf2eot = require('gulp-ttf2eot');
gulp.task('ttf2eot', function(){
gulp.src(['fonts/*.ttf'])
.pipe(ttf2eot())
.pipe(gulp.dest('fonts/'));
});
```
## API
### ttf2eot(options)
#### options.ignoreExt
Type: `Boolean`
Default value: `false`
Set to true to also convert files that doesn't have the .ttf extension.
#### options.clone
Type: `Boolean`
Default value: `false`
Set to true to clone the file before converting him so that it will output the
original file too.
### Note
You may look after a full Gulp web font workflow, see
[gulp-iconfont](https://github.com/nfroidure/gulp-iconfont)
fot that matter.
## Stats
[![NPM](https://nodei.co/npm/gulp-ttf2eot.png?downloads=true&stars=true)](https://nodei.co/npm/gulp-ttf2eot/)
[![NPM](https://nodei.co/npm-dl/gulp-ttf2eot.png)](https://nodei.co/npm/gulp-ttf2eot/)
### Contributing / Issues
Please submit TTF to EOT related issues to the
[ttf2eot project](https://github.com/fontello/ttf2eot)
on wich gulp-ttf2eot is built.
This repository issues is only for gulp and gulp tasks related issues.
You may want to contribute to this project, pull requests are welcome if you
accept to publish under the MIT licence.

View File

@ -0,0 +1,78 @@
{
"_from": "gulp-ttf2eot@^1.1.1",
"_id": "gulp-ttf2eot@1.1.2",
"_inBundle": false,
"_integrity": "sha1-Z1Fv4lO67Ls5ELQXoI3LUeNKyww=",
"_location": "/gulp-ttf2eot",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "gulp-ttf2eot@^1.1.1",
"name": "gulp-ttf2eot",
"escapedName": "gulp-ttf2eot",
"rawSpec": "^1.1.1",
"saveSpec": null,
"fetchSpec": "^1.1.1"
},
"_requiredBy": [
"/gulp-iconfont"
],
"_resolved": "https://registry.npmjs.org/gulp-ttf2eot/-/gulp-ttf2eot-1.1.2.tgz",
"_shasum": "67516fe253baecbb3910b417a08dcb51e34acb0c",
"_spec": "gulp-ttf2eot@^1.1.1",
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/gulp-iconfont",
"author": {
"name": "Nicolas Froidure",
"url": "http://www.insertafter.com/blog.html"
},
"bugs": {
"url": "https://github.com/nfroidure/gulp-ttf2eot/issues"
},
"bundleDependencies": false,
"dependencies": {
"bufferstreams": "^1.1.0",
"gulp-util": "^3.0.7",
"readable-stream": "^2.0.4",
"ttf2eot": "^2.0.0"
},
"deprecated": false,
"description": "Create an EOT font from a TTF one",
"devDependencies": {
"coveralls": "^2.11.4",
"gulp": "^3.9.0",
"istanbul": "^0.4.0",
"mocha": "^3.4.2",
"mocha-lcov-reporter": "^1.0.0",
"streamtest": "^1.2.1"
},
"engines": {
"node": ">= 0.10.0"
},
"homepage": "https://github.com/nfroidure/gulp-ttf2eot",
"keywords": [
"gulpplugin",
"gulp",
"gulp-plugin",
"font",
"eot",
"ttf",
"converter"
],
"license": "MIT",
"main": "src/index.js",
"name": "gulp-ttf2eot",
"repository": {
"type": "git",
"url": "git://github.com/nfroidure/gulp-ttf2eot.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",
"lint": "eslint src/*.js tests/*.js",
"preversion": "npm test",
"test": "mocha tests/*.mocha.js"
},
"version": "1.1.2"
}

View File

@ -0,0 +1,102 @@
'use strict';
var path = require('path');
var Stream = require('readable-stream');
var gutil = require('gulp-util');
var BufferStreams = require('bufferstreams');
var ttf2eot = require('ttf2eot');
var PLUGIN_NAME = 'gulp-ttf2eot';
// File level transform function
function ttf2eotTransform() {
// Return a callback function handling the buffered content
return function ttf2eotTransformCb(err, buf, cb) {
// Handle any error
if(err) {
return cb(new gutil.PluginError(PLUGIN_NAME, err, { showStack: true }));
}
// Use the buffered content
try {
buf = new Buffer(ttf2eot(new Uint8Array(buf)).buffer);
return cb(null, buf);
} catch(err2) {
return cb(new gutil.PluginError(PLUGIN_NAME, err2, { showStack: true }));
}
};
}
// Plugin function
function ttf2eotGulp(options) {
var stream = new Stream.Transform({ objectMode: true });
options = options || {};
options.ignoreExt = options.ignoreExt || false;
options.clone = options.clone || false;
stream._transform = function ttf2eotTransformStream(file, unused, done) {
var cntStream;
var newFile;
// When null just pass through
if(file.isNull()) {
stream.push(file); done();
return;
}
// If the ext doesn't match, pass it through
if((!options.ignoreExt) && '.ttf' !== path.extname(file.path)) {
stream.push(file); done();
return;
}
// Fix for the vinyl clone method...
// https://github.com/wearefractal/vinyl/pull/9
if(options.clone) {
if(file.isBuffer()) {
stream.push(file.clone());
} else {
cntStream = file.contents;
file.contents = null;
newFile = file.clone();
file.contents = cntStream.pipe(new Stream.PassThrough());
newFile.contents = cntStream.pipe(new Stream.PassThrough());
stream.push(newFile);
}
}
file.path = gutil.replaceExtension(file.path, '.eot');
// Buffers
if(file.isBuffer()) {
try {
file.contents = new Buffer(ttf2eot(
new Uint8Array(file.contents)
).buffer);
} catch(err) {
stream.emit('error', new gutil.PluginError(PLUGIN_NAME, err, {
showStack: true,
}));
}
// Streams
} else {
file.contents = file.contents.pipe(new BufferStreams(ttf2eotTransform()));
}
stream.push(file);
done();
};
return stream;
}
// Export the file level transform function for other plugins usage
ttf2eotGulp.fileTransform = ttf2eotTransform;
// Export the plugin main function
module.exports = ttf2eotGulp;

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,184 @@
/* eslint max-nested-callbacks:0 func-names:0 */
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var Stream = require('stream');
var fs = require('fs');
var path = require('path');
var assert = require('assert');
var StreamTest = require('streamtest');
var ttf2eot = require('../src/index.js');
describe('gulp-ttf2eot conversion', function() {
var filename = path.join(__dirname, 'fixtures', 'iconsfont');
var eot = fs.readFileSync(filename + '.eot');
// Iterating through versions
StreamTest.versions.forEach(function(version) {
describe('for ' + version + ' streams', function() {
describe('with null contents', function() {
it('should let null files pass through', function(done) {
StreamTest[version].fromObjects([new gutil.File({
path: 'bibabelula.foo',
contents: null,
})])
.pipe(ttf2eot())
.pipe(StreamTest[version].toObjects(function(err, objs) {
if(err) {
return done(err);
}
assert.equal(objs.length, 1);
assert.equal(objs[0].path, 'bibabelula.foo');
assert.equal(objs[0].contents, null);
done();
}));
});
});
describe('in buffer mode', function() {
it('should work', function(done) {
gulp.src(filename + '.ttf', { buffer: true })
.pipe(ttf2eot())
// Uncomment to regenerate the test files if changes in the ttf2eot lib
// .pipe(gulp.dest(__dirname + '/fixtures/'))
.pipe(StreamTest[version].toObjects(function(err, objs) {
if(err) {
return done(err);
}
assert.equal(objs.length, 1);
assert.equal(objs[0].path, filename + '.eot');
assert.equal(objs[0].contents.toString('utf-8'), eot.toString('utf-8'));
done();
}));
});
it('should work with the clone option', function(done) {
gulp.src(filename + '.ttf', { buffer: true })
.pipe(ttf2eot({ clone: true }))
.pipe(StreamTest[version].toObjects(function(err, objs) {
if(err) {
return done(err);
}
assert.equal(objs.length, 2);
assert.equal(objs[0].path, filename + '.ttf');
assert.equal(
objs[0].contents.toString('utf-8'),
fs.readFileSync(filename + '.ttf', 'utf-8')
);
assert.equal(objs[1].path, filename + '.eot');
assert.equal(objs[1].contents.toString('utf-8'), eot.toString('utf-8'));
done();
}));
});
it('should let non-ttf files pass through', function(done) {
StreamTest[version].fromObjects([new gutil.File({
path: 'bibabelula.foo',
contents: new Buffer('ohyeah'),
})])
.pipe(ttf2eot())
.pipe(StreamTest[version].toObjects(function(err, objs) {
if(err) {
return done(err);
}
assert.equal(objs.length, 1);
assert.equal(objs[0].path, 'bibabelula.foo');
assert.equal(objs[0].contents.toString('utf-8'), 'ohyeah');
done();
}));
});
});
describe('in stream mode', function() {
it('should work', function(done) {
gulp.src(filename + '.ttf', { buffer: false })
.pipe(ttf2eot())
.pipe(StreamTest[version].toObjects(function(err, objs) {
if(err) {
return done(err);
}
assert.equal(objs.length, 1);
assert.equal(objs[0].path, filename + '.eot');
objs[0].contents.pipe(StreamTest[version].toText(function(err, text) {
if(err) {
return done(err);
}
assert.equal(text, eot.toString('utf-8'));
done();
}));
}));
});
it('should work with the clone option', function(done) {
gulp.src(filename + '.ttf', { buffer: false })
.pipe(ttf2eot({ clone: true }))
.pipe(StreamTest[version].toObjects(function(err, objs) {
if(err) {
return done(err);
}
assert.equal(objs.length, 2);
assert.equal(objs[0].path, filename + '.ttf');
assert.equal(objs[1].path, filename + '.eot');
objs[0].contents.pipe(StreamTest[version].toText(function(err, text) {
if(err) {
return done(err);
}
assert.equal(text, fs.readFileSync(filename + '.ttf', 'utf-8'));
objs[1].contents.pipe(StreamTest[version].toText(function(err, text) {
if(err) {
return done(err);
}
assert.equal(text, eot.toString('utf-8'));
done();
}));
}));
}));
});
it('should let non-ttf files pass through', function(done) {
StreamTest[version].fromObjects([new gutil.File({
path: 'bibabelula.foo',
contents: new Stream.PassThrough(),
})])
.pipe(ttf2eot())
.pipe(StreamTest[version].toObjects(function(err, objs) {
if(err) {
return done(err);
}
assert.equal(objs.length, 1);
assert.equal(objs[0].path, 'bibabelula.foo');
assert(objs[0].contents instanceof Stream.PassThrough);
done();
}));
});
});
});
});
});