diff --git a/test/font/font_fpgm_spec.js b/test/font/font_fpgm_spec.js index 5c53827e6..66ca8752b 100644 --- a/test/font/font_fpgm_spec.js +++ b/test/font/font_fpgm_spec.js @@ -31,7 +31,9 @@ describe("font_fpgm", function () { verifyTtxOutput(output); expect( - /(ENDF\[ \]|SVTCA\[0\])\s*<\/assembly>\s*<\/fpgm>/.test(output) + /(ENDF\[ \]|SVTCA\[0\])\s*\/\*.*\*\/\s*<\/assembly>\s*<\/fpgm>/.test( + output + ) ).toEqual(true); }); }); diff --git a/test/font/font_os2_spec.js b/test/font/font_os2_spec.js index fac47f84c..04359d316 100644 --- a/test/font/font_os2_spec.js +++ b/test/font/font_os2_spec.js @@ -30,7 +30,9 @@ describe("font_post", function () { const output = await ttx(font.data); verifyTtxOutput(output); - expect(/\s*/.test(output)).toEqual(true); + expect( + /\s*\s*/.test(output) + ).toEqual(true); }); it("has invalid selection attributes presence", async function () { @@ -51,7 +53,9 @@ describe("font_post", function () { const output = await ttx(font.data); verifyTtxOutput(output); - expect(/\s*/.test(output)).toEqual(true); + expect( + /\s*\s*/.test(output) + ).toEqual(true); }); }); }); diff --git a/test/font/ttxdriver.js b/test/font/ttxdriver.js index e0c664402..310512590 100644 --- a/test/font/ttxdriver.js +++ b/test/font/ttxdriver.js @@ -28,7 +28,7 @@ function runTtx(ttxResourcesHomePath, fontPath, registerOnCancel, callback) { fs.realpath(ttxResourcesHomePath, function (error, realTtxResourcesHomePath) { const fontToolsHome = path.join(realTtxResourcesHomePath, "fonttools-code"); fs.realpath(fontPath, function (errorFontPath, realFontPath) { - const ttxPath = path.join("Tools", "ttx"); + const ttxPath = path.join("Lib", "fontTools", "ttx.py"); if (!fs.existsSync(path.join(fontToolsHome, ttxPath))) { callback("TTX was not found, please checkout PDF.js submodules"); return; @@ -38,7 +38,8 @@ function runTtx(ttxResourcesHomePath, fontPath, registerOnCancel, callback) { PYTHONDONTWRITEBYTECODE: true, }; const ttxStdioMode = "ignore"; - const ttx = spawn("python", [ttxPath, realFontPath], { + const python = process.platform !== "win32" ? "python2" : "python"; + const ttx = spawn(python, [ttxPath, realFontPath], { cwd: fontToolsHome, stdio: ttxStdioMode, env: ttxEnv, diff --git a/test/ttx/README.md b/test/ttx/README.md index 857767660..98bfd8692 100644 --- a/test/ttx/README.md +++ b/test/ttx/README.md @@ -1,3 +1 @@ If `git clone --recursive` was not used, please run `git submodule init; git submodule update` to pull fonttools code. - -Note: python 2.6 for 32-bit is required to run ttx. diff --git a/test/ttx/fonttools-code b/test/ttx/fonttools-code index 8388a2e37..d8170131a 160000 --- a/test/ttx/fonttools-code +++ b/test/ttx/fonttools-code @@ -1 +1 @@ -Subproject commit 8388a2e37ce349dac6555bb824c82723e3b65fbf +Subproject commit d8170131a3458ffbc19089cf33249777bde390e7