otb-ttc-bundle 1.7.3 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,6 @@ export declare class ArgParser implements CliArgSource {
15
15
  private handleOption;
16
16
  private handleArgument;
17
17
  }
18
- export declare function displayHelp(): void;
19
- export declare function displayVersion(): void;
18
+ export declare function displayHelp(): Promise<void>;
19
+ export declare function displayVersion(): Promise<void>;
20
20
  //# sourceMappingURL=arg-parser.d.ts.map
package/lib/arg-parser.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.displayVersion = exports.displayHelp = exports.ArgParser = void 0;
3
+ exports.ArgParser = void 0;
4
+ exports.displayHelp = displayHelp;
5
+ exports.displayVersion = displayVersion;
4
6
  const cli_help_shower_1 = require("@ot-builder/cli-help-shower");
5
7
  const cli_shared_1 = require("@ot-builder/cli-shared");
6
8
  const package_version_1 = require("./package-version");
@@ -76,9 +78,9 @@ class ArgParser {
76
78
  }
77
79
  }
78
80
  exports.ArgParser = ArgParser;
79
- function displayHelp() {
81
+ async function displayHelp() {
80
82
  new cli_help_shower_1.CliHelpShower()
81
- .message(`otb-ttc-bundle: TTC bundler, version ${package_version_1.packageVersion}`)
83
+ .message(`otb-ttc-bundle: TTC bundler, version ${await (0, package_version_1.getPackageVersion)()}`)
82
84
  .message(cli_help_shower_1.Style.Rule)
83
85
  .message(`Usage:`)
84
86
  .withIndent(cli_help_shower_1.Style.Bullet, s => {
@@ -122,9 +124,7 @@ function displayHelp() {
122
124
  });
123
125
  });
124
126
  }
125
- exports.displayHelp = displayHelp;
126
- function displayVersion() {
127
- console.log(package_version_1.packageVersion);
127
+ async function displayVersion() {
128
+ console.log(await (0, package_version_1.getPackageVersion)());
128
129
  }
129
- exports.displayVersion = displayVersion;
130
130
  //# sourceMappingURL=arg-parser.js.map
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { FontIo } from "ot-builder";
3
2
  export declare function createTtcSlices(input: Buffer[], sharing: null | number[][]): FontIo.TableSliceCollection[];
4
3
  //# sourceMappingURL=create-ttc.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTtcSlices = void 0;
3
+ exports.createTtcSlices = createTtcSlices;
4
4
  const ot_builder_1 = require("ot-builder");
5
5
  const sparse_glyf_data_processor_1 = require("./sparse-glyf-data-processor");
6
6
  const sparse_gvar_data_processor_1 = require("./sparse-gvar-data-processor");
@@ -14,7 +14,6 @@ function createTtcSlices(input, sharing) {
14
14
  }
15
15
  return fonts;
16
16
  }
17
- exports.createTtcSlices = createTtcSlices;
18
17
  function convertSfntToCustom(sfnt) {
19
18
  const ds = { version: sfnt.version, tables: new Map() };
20
19
  for (const [tag, table] of sfnt.tables)
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decideGlyphClass = exports.GlyphClass = void 0;
3
+ exports.GlyphClass = void 0;
4
+ exports.decideGlyphClass = decideGlyphClass;
4
5
  const ot_builder_1 = require("ot-builder");
5
6
  var GlyphClass;
6
7
  (function (GlyphClass) {
@@ -30,5 +31,4 @@ function decideGlyphClass(glyph, gid, commonWidth, commonHeight) {
30
31
  gk |= GlyphClass.CommonHeight;
31
32
  return gk;
32
33
  }
33
- exports.decideGlyphClass = decideGlyphClass;
34
34
  //# sourceMappingURL=glyph-class.js.map
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export type GlyphData = {
3
2
  hash: string;
4
3
  buffer: Buffer;
@@ -11,5 +10,5 @@ export type DataBlockBuildResults = {
11
10
  saGidMaps: Map<string, number>[];
12
11
  };
13
12
  export declare function buildDataBlock(shared: GlyphSharingMap[]): DataBlockBuildResults;
14
- export declare function buildOffsetIndex(offsets: number[], validateAlign: boolean): Buffer;
13
+ export declare function buildOffsetIndex(offsets: number[], validateAlign: boolean): Buffer<ArrayBuffer>;
15
14
  //# sourceMappingURL=sparse-common.d.ts.map
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildOffsetIndex = exports.buildDataBlock = exports.pushGlyphs = void 0;
3
+ exports.pushGlyphs = pushGlyphs;
4
+ exports.buildDataBlock = buildDataBlock;
5
+ exports.buildOffsetIndex = buildOffsetIndex;
4
6
  function pushGlyphs(sink, fid, gds, sharing) {
5
7
  const sh = sharing[fid];
6
8
  if (gds.length !== sh.length)
@@ -11,7 +13,6 @@ function pushGlyphs(sink, fid, gds, sharing) {
11
13
  sink[sh[gid]].set(gds[gid].hash, gds[gid].buffer);
12
14
  }
13
15
  }
14
- exports.pushGlyphs = pushGlyphs;
15
16
  function allocateGid(shared) {
16
17
  let saGid = 0;
17
18
  const saGidMaps = [];
@@ -45,7 +46,6 @@ function buildDataBlock(shared) {
45
46
  }
46
47
  return { dataBlock: dataBlock, offsets: offsets, saGidMaps };
47
48
  }
48
- exports.buildDataBlock = buildDataBlock;
49
49
  function buildOffsetIndex(offsets, validateAlign) {
50
50
  const buf = Buffer.alloc(offsets.length * 4);
51
51
  for (let j = 0; j < offsets.length; j++) {
@@ -55,5 +55,4 @@ function buildOffsetIndex(offsets, validateAlign) {
55
55
  }
56
56
  return buf;
57
57
  }
58
- exports.buildOffsetIndex = buildOffsetIndex;
59
58
  //# sourceMappingURL=sparse-common.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sparseShareGlyfData = void 0;
3
+ exports.sparseShareGlyfData = sparseShareGlyfData;
4
4
  const Crypto = require("crypto");
5
5
  const sparse_common_1 = require("./sparse-common");
6
6
  const IndexToLocFormatOffset = 50;
@@ -24,7 +24,6 @@ function sparseShareGlyfData(fonts, sharing) {
24
24
  task.head.data.writeUInt16BE(1, IndexToLocFormatOffset);
25
25
  }
26
26
  }
27
- exports.sparseShareGlyfData = sparseShareGlyfData;
28
27
  function taskToLocaBuf(entry, sharing, db) {
29
28
  const sh = sharing[entry.fontID];
30
29
  const entryOffsets = [];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sparseShareGvarData = void 0;
3
+ exports.sparseShareGvarData = sparseShareGvarData;
4
4
  const Crypto = require("crypto");
5
5
  const sparse_common_1 = require("./sparse-common");
6
6
  // Layout: Viewed from font 1 Viewed font font 2
@@ -57,7 +57,6 @@ function sparseShareGvarData(fonts, sharing) {
57
57
  start += gvarInitialSize(task);
58
58
  }
59
59
  }
60
- exports.sparseShareGvarData = sparseShareGvarData;
61
60
  function taskToLocaBuf(task, sharing, db, deltaOffsetOfRest) {
62
61
  const sh = sharing[task.fontID];
63
62
  const entryOffsets = [];
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cliMain = void 0;
3
+ exports.cliMain = cliMain;
4
4
  const Fs = require("fs");
5
5
  const cli_shared_1 = require("@ot-builder/cli-shared");
6
6
  const ot_builder_1 = require("ot-builder");
@@ -12,9 +12,9 @@ async function cliMain(argv) {
12
12
  for (const arg of argv.slice(2))
13
13
  args.arg(arg);
14
14
  if (args.displayHelp)
15
- return (0, arg_parser_1.displayHelp)();
15
+ return await (0, arg_parser_1.displayHelp)();
16
16
  if (args.displayVersion)
17
- return (0, arg_parser_1.displayVersion)();
17
+ return await (0, arg_parser_1.displayVersion)();
18
18
  if (!args.inputs || !args.inputs.length) {
19
19
  throw new Error("Please specify at least one input font. Exit.");
20
20
  }
@@ -28,7 +28,6 @@ async function cliMain(argv) {
28
28
  await glyphSharingMerging(args);
29
29
  }
30
30
  }
31
- exports.cliMain = cliMain;
32
31
  async function simpleMerging(args) {
33
32
  const sfntList = [];
34
33
  for (const input of args.inputs) {
@@ -1,2 +1,2 @@
1
- export declare const packageVersion: string;
1
+ export declare function getPackageVersion(): Promise<string>;
2
2
  //# sourceMappingURL=package-version.d.ts.map
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- /* eslint-disable @typescript-eslint/no-var-requires */
4
2
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.packageVersion = void 0;
6
- const pJson = require("../package.json");
7
- exports.packageVersion = pJson.version;
3
+ exports.getPackageVersion = getPackageVersion;
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ async function getPackageVersion() {
7
+ const moduleDir = path.join(__dirname, "..");
8
+ const json = JSON.parse(await fs.promises.readFile(path.join(moduleDir, "package.json"), "utf-8"));
9
+ return json.version;
10
+ }
8
11
  //# sourceMappingURL=package-version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "otb-ttc-bundle",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "bin": {
5
5
  "otb-ttc-bundle": "./bin/otb-ttc-bundle"
6
6
  },
@@ -26,13 +26,13 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "tslib": "^2.0.0",
30
- "ot-builder": "1.7.3",
31
- "@ot-builder/cli-help-shower": "1.7.3",
32
- "@ot-builder/cli-shared": "1.7.3"
29
+ "tslib": "^2.8.1",
30
+ "ot-builder": "1.7.5",
31
+ "@ot-builder/cli-help-shower": "1.7.5",
32
+ "@ot-builder/cli-shared": "1.7.5"
33
33
  },
34
34
  "devDependencies": {
35
- "@types/jest": "^29.5.5",
36
- "jest": "^29.6.2"
35
+ "@types/jest": "^29.5.14",
36
+ "jest": "^29.7.0"
37
37
  }
38
38
  }