@ot-builder/io-bin-ttf 1.1.2 → 1.2.0

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.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,106 @@
2
2
  "name": "@ot-builder/io-bin-ttf",
3
3
  "entries": [
4
4
  {
5
- "date": "Sat, 25 Sep 2021 01:06:38 GMT",
5
+ "date": "Sat, 09 Oct 2021 01:05:28 GMT",
6
+ "tag": "@ot-builder/io-bin-ttf_v1.2.0",
7
+ "version": "1.2.0",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "author": "otbbuilder-dev@users.noreply.github.com",
12
+ "package": "@ot-builder/io-bin-ttf",
13
+ "comment": "Add support for VTT private tables",
14
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@ot-builder/io-bin-ttf",
19
+ "comment": "Bump @ot-builder/bin-util to v1.2.0",
20
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@ot-builder/io-bin-ttf",
25
+ "comment": "Bump @ot-builder/common-impl to v1.2.0",
26
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@ot-builder/io-bin-ttf",
31
+ "comment": "Bump @ot-builder/errors to v1.2.0",
32
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@ot-builder/io-bin-ttf",
37
+ "comment": "Bump @ot-builder/ot-glyphs to v1.2.0",
38
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@ot-builder/io-bin-ttf",
43
+ "comment": "Bump @ot-builder/ot-metadata to v1.2.0",
44
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@ot-builder/io-bin-ttf",
49
+ "comment": "Bump @ot-builder/prelude to v1.2.0",
50
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
51
+ },
52
+ {
53
+ "author": "beachball",
54
+ "package": "@ot-builder/io-bin-ttf",
55
+ "comment": "Bump @ot-builder/primitive to v1.2.0",
56
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
57
+ },
58
+ {
59
+ "author": "beachball",
60
+ "package": "@ot-builder/io-bin-ttf",
61
+ "comment": "Bump @ot-builder/stat-glyphs to v1.2.0",
62
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
63
+ },
64
+ {
65
+ "author": "beachball",
66
+ "package": "@ot-builder/io-bin-ttf",
67
+ "comment": "Bump @ot-builder/var-store to v1.2.0",
68
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
69
+ },
70
+ {
71
+ "author": "beachball",
72
+ "package": "@ot-builder/io-bin-ttf",
73
+ "comment": "Bump @ot-builder/variance to v1.2.0",
74
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
75
+ },
76
+ {
77
+ "author": "beachball",
78
+ "package": "@ot-builder/io-bin-ttf",
79
+ "comment": "Bump @ot-builder/ot-sfnt to v1.2.0",
80
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
81
+ },
82
+ {
83
+ "author": "beachball",
84
+ "package": "@ot-builder/io-bin-ttf",
85
+ "comment": "Bump @ot-builder/io-bin-metadata to v1.2.0",
86
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
87
+ },
88
+ {
89
+ "author": "beachball",
90
+ "package": "@ot-builder/io-bin-ttf",
91
+ "comment": "Bump @ot-builder/io-bin-sfnt to v1.2.0",
92
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
93
+ },
94
+ {
95
+ "author": "beachball",
96
+ "package": "@ot-builder/io-bin-ttf",
97
+ "comment": "Bump @ot-builder/test-util to v1.2.0",
98
+ "commit": "cd0361ffd9d2fc5081804b14f9bfddc7fe296008"
99
+ }
100
+ ]
101
+ }
102
+ },
103
+ {
104
+ "date": "Sat, 25 Sep 2021 01:08:03 GMT",
6
105
  "tag": "@ot-builder/io-bin-ttf_v1.1.2",
7
106
  "version": "1.1.2",
8
107
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,34 @@
1
1
  # Change Log - @ot-builder/io-bin-ttf
2
2
 
3
- This log was last generated on Sat, 25 Sep 2021 01:06:38 GMT and should not be manually modified.
3
+ This log was last generated on Sat, 09 Oct 2021 01:05:28 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.2.0
8
+
9
+ Sat, 09 Oct 2021 01:05:28 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Add support for VTT private tables (otbbuilder-dev@users.noreply.github.com)
14
+ - Bump @ot-builder/bin-util to v1.2.0
15
+ - Bump @ot-builder/common-impl to v1.2.0
16
+ - Bump @ot-builder/errors to v1.2.0
17
+ - Bump @ot-builder/ot-glyphs to v1.2.0
18
+ - Bump @ot-builder/ot-metadata to v1.2.0
19
+ - Bump @ot-builder/prelude to v1.2.0
20
+ - Bump @ot-builder/primitive to v1.2.0
21
+ - Bump @ot-builder/stat-glyphs to v1.2.0
22
+ - Bump @ot-builder/var-store to v1.2.0
23
+ - Bump @ot-builder/variance to v1.2.0
24
+ - Bump @ot-builder/ot-sfnt to v1.2.0
25
+ - Bump @ot-builder/io-bin-metadata to v1.2.0
26
+ - Bump @ot-builder/io-bin-sfnt to v1.2.0
27
+ - Bump @ot-builder/test-util to v1.2.0
28
+
7
29
  ## 1.1.2
8
30
 
9
- Sat, 25 Sep 2021 01:06:38 GMT
31
+ Sat, 25 Sep 2021 01:08:03 GMT
10
32
 
11
33
  ### Patches
12
34
 
@@ -0,0 +1,7 @@
1
+ export interface TtfWritingExtraInfoSink {
2
+ setComponentInfo(glyphID: number, componentID: number, flags: number, targetGID: number, arg1: number, arg2: number, argXScale: number, argScale01: number, argScale10: number, argYScale: number): void;
3
+ }
4
+ export declare class NopTtfWritingExtraInfoSink implements TtfWritingExtraInfoSink {
5
+ setComponentInfo(): void;
6
+ }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NopTtfWritingExtraInfoSink = void 0;
4
+ class NopTtfWritingExtraInfoSink {
5
+ setComponentInfo() { }
6
+ }
7
+ exports.NopTtfWritingExtraInfoSink = NopTtfWritingExtraInfoSink;
8
+ //# sourceMappingURL=index.js.map
@@ -14,7 +14,7 @@ export declare enum ComponentFlag {
14
14
  ARGS_ARE_XY_VALUES = 2,
15
15
  ROUND_XY_TO_GRID = 4,
16
16
  WE_HAVE_A_SCALE = 8,
17
- RESERVED = 16,
17
+ NON_OVERLAPPING = 16,
18
18
  MORE_COMPONENTS = 32,
19
19
  WE_HAVE_AN_X_AND_Y_SCALE = 64,
20
20
  WE_HAVE_A_TWO_BY_TWO = 128,
@@ -19,7 +19,7 @@ var ComponentFlag;
19
19
  ComponentFlag[ComponentFlag["ARGS_ARE_XY_VALUES"] = 2] = "ARGS_ARE_XY_VALUES";
20
20
  ComponentFlag[ComponentFlag["ROUND_XY_TO_GRID"] = 4] = "ROUND_XY_TO_GRID";
21
21
  ComponentFlag[ComponentFlag["WE_HAVE_A_SCALE"] = 8] = "WE_HAVE_A_SCALE";
22
- ComponentFlag[ComponentFlag["RESERVED"] = 16] = "RESERVED";
22
+ ComponentFlag[ComponentFlag["NON_OVERLAPPING"] = 16] = "NON_OVERLAPPING";
23
23
  ComponentFlag[ComponentFlag["MORE_COMPONENTS"] = 32] = "MORE_COMPONENTS";
24
24
  ComponentFlag[ComponentFlag["WE_HAVE_AN_X_AND_Y_SCALE"] = 64] = "WE_HAVE_AN_X_AND_Y_SCALE";
25
25
  ComponentFlag[ComponentFlag["WE_HAVE_A_TWO_BY_TWO"] = 128] = "WE_HAVE_A_TWO_BY_TWO";
@@ -1,6 +1,7 @@
1
1
  import { Write } from "@ot-builder/bin-util";
2
2
  import { OtGlyph } from "@ot-builder/ot-glyphs";
3
3
  import { Data } from "@ot-builder/prelude";
4
+ import { TtfWritingExtraInfoSink } from "../extra-info-sink/index";
4
5
  import { LocaTable } from "./loca";
5
- export declare const GlyfTableWrite: Write<Data.Order<OtGlyph>, [outLoca: LocaTable, stat: OtGlyph.Stat.Sink]>;
6
+ export declare const GlyfTableWrite: Write<Data.Order<OtGlyph>, [outLoca: LocaTable, stat: OtGlyph.Stat.Sink, extraInfoSink: TtfWritingExtraInfoSink]>;
6
7
  //# sourceMappingURL=write.d.ts.map
package/lib/glyf/write.js CHANGED
@@ -185,7 +185,7 @@ function writeComponentTransform(frag, flag, transform) {
185
185
  frag.push(primitive_1.F2D14, transform.yy);
186
186
  }
187
187
  }
188
- const CompositeGlyphData = (0, bin_util_1.Write)((frag, cg, gOrd) => {
188
+ const CompositeGlyphData = (0, bin_util_1.Write)((frag, cg, iGlyph, gOrd, extraInfoSink) => {
189
189
  const st = cg.getStatData();
190
190
  frag.int16(-1)
191
191
  .int16(st.extent.xMin)
@@ -201,22 +201,25 @@ const CompositeGlyphData = (0, bin_util_1.Write)((frag, cg, gOrd) => {
201
201
  flag |= shared_1.ComponentFlag.MORE_COMPONENTS;
202
202
  else if (cg.instructions.byteLength)
203
203
  flag |= shared_1.ComponentFlag.WE_HAVE_INSTRUCTIONS;
204
+ const targetGID = gOrd.reverse(ref.to);
204
205
  frag.uint16(flag);
205
- frag.uint16(gOrd.reverse(ref.to));
206
+ frag.uint16(targetGID);
206
207
  writeComponentArgs(frag, flag, arg1, arg2);
207
208
  writeComponentTransform(frag, flag, ref.transform);
208
209
  if (flag & shared_1.ComponentFlag.WE_HAVE_INSTRUCTIONS) {
209
210
  frag.uint16(cg.instructions.byteLength);
210
211
  frag.bytes(cg.instructions);
211
212
  }
213
+ extraInfoSink.setComponentInfo(iGlyph, rid, flag, targetGID, arg1, arg2, ref.transform.xx, ref.transform.yx, ref.transform.xy, ref.transform.yy);
212
214
  }
213
215
  });
214
- exports.GlyfTableWrite = (0, bin_util_1.Write)((frag, gOrd, outLoca, stat) => {
216
+ exports.GlyfTableWrite = (0, bin_util_1.Write)((frag, gOrd, outLoca, stat, extraInfoSink) => {
215
217
  const sink = new StdGlyfDataSink(outLoca, frag);
216
218
  sink.begin();
217
219
  stat.setNumGlyphs(gOrd.length);
218
220
  const classifier = new classifier_1.GlyphClassifier(gOrd);
219
- for (const glyph of gOrd) {
221
+ for (let iGlyph = 0; iGlyph < gOrd.length; iGlyph++) {
222
+ const glyph = gOrd.at(iGlyph);
220
223
  const cg = classifier.classify(glyph);
221
224
  cg.stat(stat);
222
225
  const fGlyph = new bin_util_1.Frag();
@@ -224,7 +227,7 @@ exports.GlyfTableWrite = (0, bin_util_1.Write)((frag, gOrd, outLoca, stat) => {
224
227
  fGlyph.push(SimpleGlyphData, cg);
225
228
  }
226
229
  else if (cg instanceof classifier_1.CompositeGlyph) {
227
- fGlyph.push(CompositeGlyphData, cg, gOrd);
230
+ fGlyph.push(CompositeGlyphData, cg, iGlyph, gOrd, extraInfoSink);
228
231
  }
229
232
  sink.add(fGlyph);
230
233
  }
package/lib/index.d.ts CHANGED
@@ -2,8 +2,10 @@ import { LocaTable } from "./glyf/loca";
2
2
  export * from "./cvt/index";
3
3
  export * from "./cvar/index";
4
4
  export * from "./fpgm-prep/index";
5
- export * from "./cfg";
5
+ export * from "./cfg/index";
6
+ export * from "./extra-info-sink/index";
6
7
  export * from "./rectify/rectify";
8
+ export * from "./glyf/shared";
7
9
  export declare namespace Loca {
8
10
  type Table = LocaTable;
9
11
  const Tag = "loca";
@@ -15,11 +17,11 @@ export declare namespace Loca {
15
17
  export declare namespace Glyf {
16
18
  const Tag = "glyf";
17
19
  const Read: import("@ot-builder/bin-util").Read<void, [loca: LocaTable, gOrd: import("@ot-builder/prelude/lib/data").Order<import("@ot-builder/ot-glyphs").OtGlyph>, coStat: import("@ot-builder/ot-glyphs/lib/ot-glyph/co-stat").Source]>;
18
- const Write: import("@ot-builder/bin-util").Write<import("@ot-builder/prelude/lib/data").Order<import("@ot-builder/ot-glyphs").OtGlyph>, [outLoca: LocaTable, stat: import("@ot-builder/ot-glyphs/lib/ot-glyph/stat").Sink]>;
20
+ const Write: import("@ot-builder/bin-util").Write<import("@ot-builder/prelude/lib/data").Order<import("@ot-builder/ot-glyphs").OtGlyph>, [outLoca: LocaTable, stat: import("@ot-builder/ot-glyphs/lib/ot-glyph/stat").Sink, extraInfoSink: import("./extra-info-sink/index").TtfWritingExtraInfoSink]>;
19
21
  }
20
22
  export declare namespace Gvar {
21
23
  const Tag = "gvar";
22
- const Read: import("@ot-builder/bin-util").Read<void, [gOrd: import("@ot-builder/prelude/lib/data").Order<import("@ot-builder/ot-glyphs").OtGlyph>, cfg: import("./cfg").TtfCfg, ignore: import("./gvar/read").GvarReadIgnore, designSpace: import("@ot-builder/variance/lib/otvar-impl").DesignSpace]>;
23
- const Write: import("@ot-builder/bin-util").Write<import("@ot-builder/prelude/lib/data").Order<import("@ot-builder/ot-glyphs").OtGlyph>, [cfg: import("./cfg").TtfCfg, designSpace: import("@ot-builder/variance/lib/otvar-impl").DesignSpace, acEmpty?: import("@ot-builder/common-impl").Access<boolean> | undefined]>;
24
+ const Read: import("@ot-builder/bin-util").Read<void, [gOrd: import("@ot-builder/prelude/lib/data").Order<import("@ot-builder/ot-glyphs").OtGlyph>, cfg: import("./cfg/index").TtfCfg, ignore: import("./gvar/read").GvarReadIgnore, designSpace: import("@ot-builder/variance/lib/otvar-impl").DesignSpace]>;
25
+ const Write: import("@ot-builder/bin-util").Write<import("@ot-builder/prelude/lib/data").Order<import("@ot-builder/ot-glyphs").OtGlyph>, [cfg: import("./cfg/index").TtfCfg, designSpace: import("@ot-builder/variance/lib/otvar-impl").DesignSpace, acEmpty?: import("@ot-builder/common-impl").Access<boolean> | undefined]>;
24
26
  }
25
27
  //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -12,8 +12,10 @@ const write_2 = require("./gvar/write");
12
12
  (0, tslib_1.__exportStar)(require("./cvt/index"), exports);
13
13
  (0, tslib_1.__exportStar)(require("./cvar/index"), exports);
14
14
  (0, tslib_1.__exportStar)(require("./fpgm-prep/index"), exports);
15
- (0, tslib_1.__exportStar)(require("./cfg"), exports);
15
+ (0, tslib_1.__exportStar)(require("./cfg/index"), exports);
16
+ (0, tslib_1.__exportStar)(require("./extra-info-sink/index"), exports);
16
17
  (0, tslib_1.__exportStar)(require("./rectify/rectify"), exports);
18
+ (0, tslib_1.__exportStar)(require("./glyf/shared"), exports);
17
19
  var Loca;
18
20
  (function (Loca) {
19
21
  Loca.Tag = loca_1.LocaTag;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ot-builder/io-bin-ttf",
3
3
  "description": "",
4
- "version": "1.1.2",
4
+ "version": "1.2.0",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -24,23 +24,23 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@ot-builder/bin-util": "1.1.2",
28
- "@ot-builder/common-impl": "1.1.2",
29
- "@ot-builder/errors": "1.1.2",
30
- "@ot-builder/ot-glyphs": "1.1.2",
31
- "@ot-builder/ot-metadata": "1.1.2",
32
- "@ot-builder/prelude": "1.1.2",
33
- "@ot-builder/primitive": "1.1.2",
34
- "@ot-builder/stat-glyphs": "1.1.2",
35
- "@ot-builder/var-store": "1.1.2",
36
- "@ot-builder/variance": "1.1.2",
27
+ "@ot-builder/bin-util": "1.2.0",
28
+ "@ot-builder/common-impl": "1.2.0",
29
+ "@ot-builder/errors": "1.2.0",
30
+ "@ot-builder/ot-glyphs": "1.2.0",
31
+ "@ot-builder/ot-metadata": "1.2.0",
32
+ "@ot-builder/prelude": "1.2.0",
33
+ "@ot-builder/primitive": "1.2.0",
34
+ "@ot-builder/stat-glyphs": "1.2.0",
35
+ "@ot-builder/var-store": "1.2.0",
36
+ "@ot-builder/variance": "1.2.0",
37
37
  "tslib": "^2.0.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@ot-builder/ot-sfnt": "1.1.2",
41
- "@ot-builder/io-bin-metadata": "1.1.2",
42
- "@ot-builder/io-bin-sfnt": "1.1.2",
43
- "@ot-builder/test-util": "1.1.2",
40
+ "@ot-builder/ot-sfnt": "1.2.0",
41
+ "@ot-builder/io-bin-metadata": "1.2.0",
42
+ "@ot-builder/io-bin-sfnt": "1.2.0",
43
+ "@ot-builder/test-util": "1.2.0",
44
44
  "@types/jest": "^26.0.23",
45
45
  "jest": "^27.0.6"
46
46
  }