+103
-70
lines changedFilter options
+103
-70
lines changed Original file line number Diff line number Diff line change
@@ -14,3 +14,4 @@ lib/
14
14
/**/trieUse.json
15
15
/**/indic.json
16
16
/**/use.json
17
+
stats.html
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ config.verbose = true;
9
9
target.all = () => {
10
10
target.clean();
11
11
target.generateTrieJson();
12
-
target.moveTrieJsonToRoot();
13
-
target.compileBabel();
12
+
target.rollupESM();
13
+
target.rollupESMMin();
14
14
target.rollupUMD();
15
15
target.rollupUMDMin();
16
16
};
@@ -22,53 +22,37 @@ target.generateTrieJson = () => {
22
22
exec('babel-node src/opentype/shapers/gen-indic.js');
23
23
};
24
24
25
-
target.moveTrieJsonToRoot = () => {
25
+
target.rollupESM = () => {
26
26
target.generateTrieJson();
27
-
mkdir('-p', 'es/opentype/shapers/')
28
-
mkdir('-p', 'lib/opentype/shapers/')
29
-
cp(
30
-
'src/opentype/shapers/trie.json',
31
-
'src/opentype/shapers/trieUse.json',
32
-
'src/opentype/shapers/trieIndic.json',
33
-
'src/opentype/shapers/indic.json',
34
-
'src/opentype/shapers/use.json',
35
-
'es/opentype/shapers/'
36
-
);
37
-
cp(
38
-
'src/opentype/shapers/trie.json',
39
-
'src/opentype/shapers/trieUse.json',
40
-
'src/opentype/shapers/trieIndic.json',
41
-
'src/opentype/shapers/indic.json',
42
-
'src/opentype/shapers/use.json',
43
-
'lib/opentype/shapers/'
44
-
);
27
+
env.UGLIFY = false;
28
+
env.MODULE_TYPE = 'esm';
29
+
exec('rollup -c rollup.config.js -o dist/fontkit.es.js');
45
30
};
46
31
47
-
target.compileBabel = () => {
48
-
target.moveTrieJsonToRoot();
49
-
env.MODULE_TYPE = 'es6';
50
-
exec(`babel --out-dir es src/`);
51
-
env.MODULE_TYPE = 'commonjs';
52
-
exec(`babel --out-dir lib src/`);
53
-
}
32
+
target.rollupESMMin = () => {
33
+
target.generateTrieJson();
34
+
env.UGLIFY = true;
35
+
env.MODULE_TYPE = 'esm';
36
+
exec('rollup -c rollup.config.js -o dist/fontkit.es.min.js');
37
+
};
54
38
55
39
target.rollupUMD = () => {
56
-
target.moveTrieJsonToRoot();
40
+
target.generateTrieJson();
57
41
env.UGLIFY = false;
58
-
exec('rollup -c rollup.config.js -o dist/fontkit.js');
42
+
env.MODULE_TYPE = 'umd';
43
+
exec('rollup -c rollup.config.js -o dist/fontkit.umd.js');
59
44
};
60
45
61
46
target.rollupUMDMin = () => {
62
-
target.moveTrieJsonToRoot();
47
+
target.generateTrieJson();
63
48
env.UGLIFY = true;
64
-
exec('rollup -c rollup.config.js -o dist/fontkit.min.js');
49
+
env.MODULE_TYPE = 'umd';
50
+
exec('rollup -c rollup.config.js -o dist/fontkit.umd.min.js');
65
51
};
66
52
67
53
target.clean = () => {
68
54
rm(
69
55
'-rf',
70
-
'lib',
71
-
'es',
72
56
'dist',
73
57
'src/opentype/shapers/trie.json',
74
58
'src/opentype/shapers/trieUse.json',
Original file line number Diff line number Diff line change
@@ -2,8 +2,10 @@
2
2
"name": "fontkit",
3
3
"version": "1.7.7",
4
4
"description": "An advanced font engine for Node and the browser",
5
-
"main": "dist/fontkit.js",
6
-
"unpkg": "dist/fontkit.min.js",
5
+
"main": "dist/fontkit.umd.js",
6
+
"unpkg": "dist/fontkit.umd.min.js",
7
+
"module": "dist/fontkit.es.js",
8
+
"types": "lib/index.d.ts",
7
9
"scripts": {
8
10
"make": "node Makefile.js",
9
11
"clean": "node Makefile.js clean",
@@ -22,20 +24,19 @@
22
24
"layout"
23
25
],
24
26
"dependencies": {
25
-
},
26
-
"devDependencies": {
27
27
"base64-arraybuffer": "^0.1.5",
28
-
"brotli": "git+https://github.com/Hopding/brotli.js.git#0350970de946950ce47c1948913827931d88fc11",
29
-
"browserify-optional": "^1.0.0",
28
+
"brotli": "git+https://github.com/Hopding/brotli.js.git#2a623817f6bd8d1f7f528f69ac8ce8067b3383fb",
30
29
"clone": "^1.0.1",
31
30
"deep-equal": "^1.0.0",
32
31
"dfa": "^1.0.0",
32
+
"iconv-lite": "^0.4.13",
33
33
"pako": "^1.0.6",
34
34
"restructure": "^0.5.3",
35
35
"tiny-inflate": "^1.0.2",
36
-
"unicode-properties": "git+https://github.com/Hopding/unicode-properties.git#d97bf46ebdcef78f838f0803ec3643e608410add",
37
-
"unicode-trie": "^0.3.0",
38
-
36
+
"unicode-properties": "git+https://github.com/Hopding/unicode-properties.git#51a63d54730b78507206f07d19bd04186e5cffe7",
37
+
"unicode-trie": "^0.3.0"
38
+
},
39
+
"devDependencies": {
39
40
"@babel/cli": "^7.2.0",
40
41
"@babel/core": "^7.2.2",
41
42
"@babel/node": "^7.2.2",
@@ -47,19 +48,18 @@
47
48
"concat-stream": "^1.4.6",
48
49
"esdoc": "^0.4.8",
49
50
"esdoc-es7-plugin": "0.0.3",
50
-
"iconv-lite": "^0.4.13",
51
51
"mocha": "^2.0.1",
52
52
"nyc": "^10.3.2",
53
53
"rollup": "^0.68.0",
54
54
"rollup-plugin-analyzer": "^2.1.0",
55
55
"rollup-plugin-babel": "^4.1.0",
56
56
"rollup-plugin-commonjs": "^9.2.0",
57
57
"rollup-plugin-json": "^3.1.0",
58
-
"rollup-plugin-local-resolve": "^1.0.7",
59
58
"rollup-plugin-node-builtins": "^2.1.2",
60
59
"rollup-plugin-node-globals": "^1.4.0",
61
60
"rollup-plugin-node-resolve": "^4.0.0",
62
-
"rollup-plugin-uglify": "^6.0.0",
61
+
"rollup-plugin-terser": "^3.0.0",
62
+
"rollup-plugin-visualizer": "^0.9.2",
63
63
"shelljs": "^0.8.3"
64
64
}
65
65
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
1
1
import babel from 'rollup-plugin-babel';
2
2
import nodeResolve from 'rollup-plugin-node-resolve';
3
-
import builtins from 'rollup-plugin-node-builtins';
4
-
import globals from 'rollup-plugin-node-globals';
3
+
import nodeBuiltins from 'rollup-plugin-node-builtins';
4
+
import nodeGlobals from 'rollup-plugin-node-globals';
5
5
import commonjs from 'rollup-plugin-commonjs';
6
6
import json from 'rollup-plugin-json';
7
-
import { uglify } from 'rollup-plugin-uglify';
7
+
import { terser } from 'rollup-plugin-terser';
8
8
import { plugin as analyze } from 'rollup-plugin-analyzer';
9
+
import visualizer from 'rollup-plugin-visualizer';
9
10
10
-
const { UGLIFY } = process.env;
11
+
const { UGLIFY, MODULE_TYPE } = process.env;
11
12
12
13
export default {
13
14
input: 'src/index.js',
14
15
output: {
15
16
name: 'fontkit',
16
-
format: 'umd',
17
+
format: MODULE_TYPE,
17
18
},
19
+
external: MODULE_TYPE === 'esm'
20
+
? ['pako'] // pdf-lib will provide pako for us
21
+
: [],
18
22
plugins: [
19
23
// analyze(),
24
+
// visualizer({
25
+
// // sourcemap: true,
26
+
// open: true,
27
+
// }),
20
28
nodeResolve({
21
29
jsnext: true,
22
30
preferBuiltins: false,
23
-
// browser: true,
24
31
}),
25
32
commonjs({
26
33
exclude: 'src/**',
@@ -32,16 +39,16 @@ export default {
32
39
babel({
33
40
babelrc: false,
34
41
presets: [
35
-
['@babel/preset-env', { loose: true }]
42
+
['@babel/preset-env', { modules: false, loose: true }]
36
43
],
37
44
plugins: [
38
45
['@babel/plugin-proposal-decorators', { legacy: true }],
39
46
['@babel/plugin-proposal-class-properties']
40
47
],
41
48
runtimeHelpers: true
42
49
}),
43
-
globals(),
44
-
builtins(),
45
-
UGLIFY === 'true' && uglify(),
50
+
nodeGlobals(),
51
+
nodeBuiltins(),
52
+
UGLIFY === 'true' && terser(),
46
53
],
47
54
};
Original file line number Diff line number Diff line change
@@ -3,10 +3,7 @@ import {getEncoding} from './encodings';
3
3
import {cache} from './decorators';
4
4
import {range} from './utils';
5
5
6
-
// iconv-lite is an optional dependency.
7
-
try {
8
-
var iconv = require('iconv-lite');
9
-
} catch (err) {}
6
+
import iconv from 'iconv-lite';
10
7
11
8
export default class CmapProcessor {
12
9
constructor(cmapTable) {
Original file line number Diff line number Diff line change
@@ -9,7 +9,8 @@ const fontkit = {
9
9
formats.push(format);
10
10
},
11
11
12
-
create: (buffer, postscriptName) => {
12
+
create: (uint8ArrayFontData, postscriptName) => {
13
+
const buffer = new Buffer.from(uint8ArrayFontData);
13
14
for (let i = 0; i < formats.length; i++) {
14
15
const format = formats[i];
15
16
if (format.probe(buffer)) {
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
1
-
// import './shims/process';
2
-
// import 'stream';
3
-
4
-
// exports.decompress = require('./dec/decode').BrotliDecompressBuffer;
5
-
6
-
// import 'brotli/dec/decode';
7
-
8
-
9
1
import fontkit from './base';
10
2
import TTFFont from './TTFFont';
11
3
import WOFFFont from './WOFFFont';
Original file line number Diff line number Diff line change
@@ -2504,6 +2504,11 @@ is-windows@^1.0.2:
2504
2504
version "1.0.2"
2505
2505
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
2506
2506
2507
+
is-wsl@^1.1.0:
2508
+
version "1.1.0"
2509
+
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d"
2510
+
integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=
2511
+
2507
2512
is@~0.2.6:
2508
2513
version "0.2.7"
2509
2514
resolved "https://registry.yarnpkg.com/is/-/is-0.2.7.tgz#3b34a2c48f359972f35042849193ae7264b63562"
@@ -3304,6 +3309,13 @@ once@^1.3.0:
3304
3309
dependencies:
3305
3310
wrappy "1"
3306
3311
3312
+
opn@^5.3.0:
3313
+
version "5.4.0"
3314
+
resolved "https://registry.yarnpkg.com/opn/-/opn-5.4.0.tgz#cb545e7aab78562beb11aa3bfabc7042e1761035"
3315
+
integrity sha512-YF9MNdVy/0qvJvDtunAOzFw9iasOQHpVthTCvGzxt61Il64AYSGdK+rYwld7NAfk9qJ7dt+hymBNSc9LNYS+Sw==
3316
+
dependencies:
3317
+
is-wsl "^1.1.0"
3318
+
3307
3319
optimist@^0.6.1:
3308
3320
version "0.6.1"
3309
3321
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
@@ -3908,6 +3920,16 @@ rollup-plugin-node-resolve@^4.0.0:
3908
3920
is-module "^1.0.0"
3909
3921
resolve "^1.8.1"
3910
3922
3923
+
rollup-plugin-terser@^3.0.0:
3924
+
version "3.0.0"
3925
+
resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-3.0.0.tgz#045bd7cf625ee1affcfe6971dab6fffe6fb48c65"
3926
+
integrity sha512-Ed9zRD7OoCBnh0XGlEAJle5TCUsFXMLClwKzZWnS1zbNO4MelHjfCSdFZxCAdH70M40nhZ1nRrY2GZQJhSMcjA==
3927
+
dependencies:
3928
+
"@babel/code-frame" "^7.0.0"
3929
+
jest-worker "^23.2.0"
3930
+
serialize-javascript "^1.5.0"
3931
+
terser "^3.8.2"
3932
+
3911
3933
rollup-plugin-uglify@^6.0.0:
3912
3934
version "6.0.0"
3913
3935
resolved "https://registry.yarnpkg.com/rollup-plugin-uglify/-/rollup-plugin-uglify-6.0.0.tgz#15aa8919e5cdc63b7cfc9319c781788b40084ce4"
@@ -3918,6 +3940,16 @@ rollup-plugin-uglify@^6.0.0:
3918
3940
serialize-javascript "^1.5.0"
3919
3941
uglify-js "^3.4.9"
3920
3942
3943
+
rollup-plugin-visualizer@^0.9.2:
3944
+
version "0.9.2"
3945
+
resolved "https://registry.yarnpkg.com/rollup-plugin-visualizer/-/rollup-plugin-visualizer-0.9.2.tgz#bbc8e8e67d5aa3e6c188c5ca0fcfa57234fb9f92"
3946
+
integrity sha512-EHXHLp9Q8v5QdRTSjgio4Alr2MKxCJroLhJunmcH+pWAM5869nI5mdWjk2jp64rjxzEahrMYmfF/G5sbTHIhKw==
3947
+
dependencies:
3948
+
mkdirp "^0.5.1"
3949
+
opn "^5.3.0"
3950
+
source-map "^0.7.3"
3951
+
typeface-oswald "0.0.54"
3952
+
3921
3953
rollup-pluginutils@^2.3.0, rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.3.3:
3922
3954
version "2.3.3"
3923
3955
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.3.3.tgz#3aad9b1eb3e7fe8262820818840bf091e5ae6794"
@@ -4072,7 +4104,7 @@ source-map-resolve@^0.5.0:
4072
4104
source-map-url "^0.4.0"
4073
4105
urix "^0.1.0"
4074
4106
4075
-
source-map-support@^0.5.9:
4107
+
source-map-support@^0.5.9, source-map-support@~0.5.6:
4076
4108
version "0.5.9"
4077
4109
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f"
4078
4110
integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==
@@ -4098,6 +4130,11 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
4098
4130
version "0.6.1"
4099
4131
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
4100
4132
4133
+
source-map@^0.7.3:
4134
+
version "0.7.3"
4135
+
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
4136
+
integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==
4137
+
4101
4138
source-map@~0.1.30:
4102
4139
version "0.1.43"
4103
4140
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346"
@@ -4269,6 +4306,15 @@ tar@^4:
4269
4306
safe-buffer "^5.1.2"
4270
4307
yallist "^3.0.2"
4271
4308
4309
+
terser@^3.8.2:
4310
+
version "3.11.0"
4311
+
resolved "https://registry.yarnpkg.com/terser/-/terser-3.11.0.tgz#60782893e1f4d6788acc696351f40636d0e37af0"
4312
+
integrity sha512-5iLMdhEPIq3zFWskpmbzmKwMQixKmTYwY3Ox9pjtSklBLnHiuQ0GKJLhL1HSYtyffHM3/lDIFBnb82m9D7ewwQ==
4313
+
dependencies:
4314
+
commander "~2.17.1"
4315
+
source-map "~0.6.1"
4316
+
source-map-support "~0.5.6"
4317
+
4272
4318
test-exclude@^4.1.0, test-exclude@^4.2.1:
4273
4319
version "4.2.1"
4274
4320
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.1.tgz#dfa222f03480bca69207ca728b37d74b45f724fa"
@@ -4368,6 +4414,11 @@ typedarray@^0.0.6:
4368
4414
version "0.0.6"
4369
4415
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
4370
4416
4417
+
typeface-oswald@0.0.54:
4418
+
version "0.0.54"
4419
+
resolved "https://registry.yarnpkg.com/typeface-oswald/-/typeface-oswald-0.0.54.tgz#1e253011622cdd50f580c04e7d625e7f449763d7"
4420
+
integrity sha512-U1WMNp4qfy4/3khIfHMVAIKnNu941MXUfs3+H9R8PFgnoz42Hh9pboSFztWr86zut0eXC8byalmVhfkiKON/8Q==
4421
+
4371
4422
uglify-js@^2.6:
4372
4423
version "2.8.29"
4373
4424
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd"
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4