Skip to content

Commit

Permalink
Update restructure to version 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
carlobeltrame authored and diegomura committed Jul 2, 2022
1 parent 39c14bb commit 81df61e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 78 deletions.
2 changes: 1 addition & 1 deletion packages/fontkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"clone": "^1.0.4",
"deep-equal": "^1.0.0",
"dfa": "^1.2.0",
"restructure": "^0.5.3",
"restructure": "^2.0.1",
"tiny-inflate": "^1.0.2",
"unicode-properties": "^1.4.1",
"unicode-trie": "^0.3.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/fontkit/src/tables/GPOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ let types = {
yPlacement: r.int16,
xAdvance: r.int16,
yAdvance: r.int16,
xPlaDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' }),
yPlaDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' }),
xAdvDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' }),
yAdvDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: 'rel' })
xPlaDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: ctx => ctx.rel }),
yPlaDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: ctx => ctx.rel }),
xAdvDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: ctx => ctx.rel }),
yAdvDevice: new r.Pointer(r.uint16, Device, { type: 'global', relativeTo: ctx => ctx.rel })
};

class ValueRecord {
Expand Down
2 changes: 1 addition & 1 deletion packages/fontkit/src/tables/gvar.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let gvar = new r.Struct({
glyphCount: r.uint16,
flags: r.uint16,
offsetToData: r.uint32,
offsets: new r.Array(new r.Pointer(Offset, 'void', { relativeTo: 'offsetToData', allowNull: false }), t => t.glyphCount + 1)
offsets: new r.Array(new r.Pointer(Offset, 'void', { relativeTo: ctx => ctx.offsetToData, allowNull: false }), t => t.glyphCount + 1)
});

export default gvar;
2 changes: 1 addition & 1 deletion packages/fontkit/src/tables/just.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ let JustificationTable = new r.Struct({
classTable: new r.Pointer(r.uint16, ClassTable, { type: 'parent' }),
wdcOffset: r.uint16,
postCompensationTable: new r.Pointer(r.uint16, PostCompensationTable, { type: 'parent' }),
widthDeltaClusters: new LookupTable(new r.Pointer(r.uint16, WidthDeltaCluster, { type: 'parent', relativeTo: 'wdcOffset' }))
widthDeltaClusters: new LookupTable(new r.Pointer(r.uint16, WidthDeltaCluster, { type: 'parent', relativeTo: ctx => ctx.wdcOffset }))
});

export default new r.Struct({
Expand Down
4 changes: 2 additions & 2 deletions packages/fontkit/src/tables/name.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ let NameRecord = new r.Struct({
length: r.uint16,
string: new r.Pointer(r.uint16,
new r.String('length', t => getEncoding(t.platformID, t.encodingID, t.languageID)),
{ type: 'parent', relativeTo: 'parent.stringOffset', allowNull: false }
{ type: 'parent', relativeTo: ctx => ctx.parent.stringOffset, allowNull: false }
)
});

let LangTagRecord = new r.Struct({
length: r.uint16,
tag: new r.Pointer(r.uint16, new r.String('length', 'utf16be'), {type: 'parent', relativeTo: 'stringOffset'})
tag: new r.Pointer(r.uint16, new r.String('length', 'utf16be'), {type: 'parent', relativeTo: ctx => ctx.stringOffset})
});

var NameTable = new r.VersionedStruct(r.uint16, {
Expand Down
75 changes: 6 additions & 69 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2864,11 +2864,6 @@ ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.5:
json-schema-traverse "^0.4.1"
uri-js "^4.2.2"

amdefine@>=0.0.4:
version "1.0.1"
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=

ansi-align@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f"
Expand Down Expand Up @@ -3110,25 +3105,11 @@ assign-symbols@^1.0.0:
resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=

[email protected]:
version "0.0.0"
resolved "https://registry.yarnpkg.com/ast-transform/-/ast-transform-0.0.0.tgz#74944058887d8283e189d954600947bc98fe0062"
integrity sha1-dJRAWIh9goPhidlUYAlHvJj+AGI=
dependencies:
escodegen "~1.2.0"
esprima "~1.0.4"
through "~2.3.4"

ast-types-flow@^0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0=

ast-types@^0.7.0:
version "0.7.8"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.7.8.tgz#902d2e0d60d071bdcd46dc115e1809ed11c138a9"
integrity sha1-kC0uDWDQcb3NRtwRXhgJ7RHBOKk=

astral-regex@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
Expand Down Expand Up @@ -3413,22 +3394,13 @@ browser-process-hrtime@^1.0.0:
resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626"
integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==

browser-resolve@^1.11.3, browser-resolve@^1.8.1:
browser-resolve@^1.11.3:
version "1.11.3"
resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6"
integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==
dependencies:
resolve "1.1.7"

browserify-optional@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/browserify-optional/-/browserify-optional-1.0.1.tgz#1e13722cfde0d85f121676c2a72ced533a018869"
integrity sha1-HhNyLP3g2F8SFnbCpyztUzoBiGk=
dependencies:
ast-transform "0.0.0"
ast-types "^0.7.0"
browser-resolve "^1.8.1"

browserify-zlib@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f"
Expand Down Expand Up @@ -4699,17 +4671,6 @@ escodegen@^1.9.1:
optionalDependencies:
source-map "~0.6.1"

escodegen@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.2.0.tgz#09de7967791cc958b7f89a2ddb6d23451af327e1"
integrity sha1-Cd55Z3kcyVi3+Jot220jRRrzJ+E=
dependencies:
esprima "~1.0.4"
estraverse "~1.5.0"
esutils "~1.0.0"
optionalDependencies:
source-map "~0.1.30"

eslint-config-airbnb-base@^14.2.1:
version "14.2.1"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz#8a2eb38455dc5a312550193b319cdaeef042cd1e"
Expand Down Expand Up @@ -4907,11 +4868,6 @@ esprima@^4.0.0, esprima@^4.0.1:
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==

esprima@~1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad"
integrity sha1-n1V+CPw7TSbs6d00+Pv0drYlha0=

esquery@^1.0.1:
version "1.4.0"
resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5"
Expand Down Expand Up @@ -4947,11 +4903,6 @@ estraverse@^5.1.0, estraverse@^5.2.0:
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880"
integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==

estraverse@~1.5.0:
version "1.5.1"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.5.1.tgz#867a3e8e58a9f84618afb6c2ddbcd916b7cbaf71"
integrity sha1-hno+jlip+EYYr7bC3bzZFrfLr3E=

estree-walker@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
Expand All @@ -4967,11 +4918,6 @@ esutils@^2.0.2:
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==

esutils@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.0.0.tgz#8151d358e20c8acc7fb745e7472c0025fe496570"
integrity sha1-gVHTWOIMisx/t0XnRywAJf5JZXA=

eventemitter3@^3.1.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7"
Expand Down Expand Up @@ -9324,12 +9270,10 @@ restore-cursor@^3.1.0:
onetime "^5.1.0"
signal-exit "^3.0.2"

restructure@^0.5.3:
version "0.5.4"
resolved "https://registry.yarnpkg.com/restructure/-/restructure-0.5.4.tgz#f54e7dd563590fb34fd6bf55876109aeccb28de8"
integrity sha1-9U591WNZD7NP1r9Vh2EJrsyyjeg=
dependencies:
browserify-optional "^1.0.0"
restructure@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/restructure/-/restructure-2.0.1.tgz#4199745466cfc9bb9e1647746a4c902b7b0049d1"
integrity sha512-e0dOpjm5DseomnXx2M5lpdZ5zoHqF1+bqdMJUohoYVVQa7cBdnk7fdmeI6byNWP/kiME72EeTiSypTCVnpLiDg==

ret@~0.1.10:
version "0.1.15"
Expand Down Expand Up @@ -9823,13 +9767,6 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==

source-map@~0.1.30:
version "0.1.43"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346"
integrity sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=
dependencies:
amdefine ">=0.0.4"

source-map@~0.7.2:
version "0.7.3"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
Expand Down Expand Up @@ -10390,7 +10327,7 @@ through2@^4.0.0:
dependencies:
readable-stream "3"

through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8, through@~2.3.4:
through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8:
version "2.3.8"
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
Expand Down

0 comments on commit 81df61e

Please sign in to comment.