Merge pull request #15158 from timvandermeij/ttx

Update `ttx` from version 2.5 to version 3.19.0
This commit is contained in:
Jonas Jenwald 2022-07-11 11:05:34 +02:00 committed by GitHub
commit e572bc4e76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 8 deletions

View File

@ -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);
});
});

View File

@ -30,7 +30,9 @@ describe("font_post", function () {
const output = await ttx(font.data);
verifyTtxOutput(output);
expect(/<OS_2>\s*<version value="3"\/>/.test(output)).toEqual(true);
expect(
/<OS_2>\s*<!--.*\r?\n.*-->\s*<version value="3"\/>/.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(/<OS_2>\s*<version value="3"\/>/.test(output)).toEqual(true);
expect(
/<OS_2>\s*<!--.*\r?\n.*-->\s*<version value="3"\/>/.test(output)
).toEqual(true);
});
});
});

View File

@ -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,

View File

@ -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.

@ -1 +1 @@
Subproject commit 8388a2e37ce349dac6555bb824c82723e3b65fbf
Subproject commit d8170131a3458ffbc19089cf33249777bde390e7