https://github.com/mozilla/pdf.js/issues/6397#issuecomment-164954332 Would have been a lot easier to find had there been an assertion checking that string16 didn't go out of bounds of the 16bit number.

const font = new Font("font", new Stream(font2154), {
        loadedName: "font",
        type: "TrueType",
        differences: [],
        defaultEncoding: [],
        toUnicode: new ToUnicodeMap([]),
      });
      const output = await ttx(font.data);
      verifyTtxOutput(output);
      expect(/<OS_2>\s*<version value="3"\/>/.test(output)).toEqual(true);
    });
    it("has invalid selection attributes presence", async function () {
      const cMap = await CMapFactory.create({
        encoding: Name.get("Identity-H"),
      });
      const font = new Font("font", new Stream(font1282), {
        loadedName: "font",
        type: "CIDFontType2",
        differences: [],
        defaultEncoding: [],
        cMap,
        toUnicode: new ToUnicodeMap([]),
      });
      const output = await ttx(font.data);
      verifyTtxOutput(output);
      expect(/<OS_2>\s*<version value="3"\/>/.test(output)).toEqual(true);
    });
  });
});