Skip to content

Commit 8e6fe5c

Browse files
committed
Skip mark-positioning lookups with null anchors instead of crashing
1 parent fbf3b9e commit 8e6fe5c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/opentype/GPOSProcessor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,10 @@ export default class GPOSProcessor extends OTProcessor {
273273
}
274274

275275
applyAnchor(markRecord, baseAnchor, baseGlyphIndex) {
276+
// A font's base/ligature/mark array may omit an anchor for a given mark
277+
// class (the cell is null). Per HarfBuzz, treat the lookup as a no-op
278+
// rather than crashing when reading xCoordinate of null.
279+
if (!baseAnchor || !markRecord.markAnchor) return;
276280
let baseCoords = this.getAnchor(baseAnchor);
277281
let markCoords = this.getAnchor(markRecord.markAnchor);
278282

0 commit comments

Comments
 (0)