Skip to content

Commit

Permalink
Fix parsing cmap subtable format 14
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored and kekee000 committed Nov 9, 2022
1 parent 4f64575 commit b5b7eaa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ttf/table/cmap/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,12 @@ function readSubTable(reader, ttf, subTable, cmapOffset) {
format14.length = reader.readUint32();
const numVarSelectorRecords = reader.readUint32();
const groups = [];
let offset = reader.offset;
for (let i = 0; i < numVarSelectorRecords; i++) {
const varSelector = reader.readUint24();
const defaultUVSOffset = reader.readUint32();
const nonDefaultUVSOffset = reader.readUint32();
const varSelector = reader.readUint24(offset);
const defaultUVSOffset = reader.readUint32(offset + 3);
const nonDefaultUVSOffset = reader.readUint32(offset + 7);
offset += 11;

if (defaultUVSOffset) {
const numUnicodeValueRanges = reader.readUint32(startOffset + defaultUVSOffset);
Expand Down

0 comments on commit b5b7eaa

Please sign in to comment.