Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"clone": "^1.0.4",
"deep-equal": "^1.0.0",
"dfa": "^1.2.0",
"restructure": "^0.5.3",
"restructure": "^2.0.0",
"tiny-inflate": "^1.0.2",
"unicode-properties": "^1.2.2",
"unicode-trie": "^0.3.0"
Expand Down
8 changes: 4 additions & 4 deletions 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
4 changes: 2 additions & 2 deletions src/tables/gvar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Offset {
// In short format, offsets are multiplied by 2.
// This doesn't seem to be documented by Apple, but it
// is implemented this way in Freetype.
return parent.flags
return parent.flags
? stream.readUInt32BE()
: stream.readUInt16BE() * 2;
}
Expand All @@ -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 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 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