diff --git a/docs/0.bootstrap.js b/docs/0.bootstrap.js index 1b2fded..23211d8 100644 --- a/docs/0.bootstrap.js +++ b/docs/0.bootstrap.js @@ -4,11 +4,11 @@ /*!**********************************!*\ !*** ../src/templates/shared.js ***! \**********************************/ -/*! exports provided: renderTableDiff, addAGlyph, addAWord, cmapDiff, diffTables, setupAnimation */ +/*! exports provided: renderTableDiff, addAGlyph, addAWord, cmapDiff, diffTables, diffKerns, setupAnimation */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"renderTableDiff\", function() { return renderTableDiff; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addAGlyph\", function() { return addAGlyph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addAWord\", function() { return addAWord; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cmapDiff\", function() { return cmapDiff; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diffTables\", function() { return diffTables; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setupAnimation\", function() { return setupAnimation; });\nfunction renderTableDiff(node, toplevel) {\n var wrapper = $(\"
\");\n if (!node) {\n return wrapper;\n }\n if (Array.isArray(node) && node.length == 2) {\n var before = $(\"\");\n before.addClass(\"attr-before\");\n before.html(\" \" + node[0] + \" \");\n var after = $(\"\");\n after.addClass(\"attr-after\");\n after.append(renderTableDiff(node[1], true).children());\n wrapper.append(before);\n wrapper.append(after);\n return wrapper;\n }\n if (node.constructor != Object) {\n var thing = $(\"\");\n thing.html(node);\n wrapper.append(thing);\n return wrapper;\n }\n for (const [key, value] of Object.entries(node)) {\n var display = $(\"
\");\n display.addClass(\"node\");\n if (!toplevel) {\n display.hide();\n }\n display.append(key);\n display.append(renderTableDiff(value, false).children());\n if (display.children(\".node\").length > 0) {\n display.addClass(\"closed\");\n }\n wrapper.append(display);\n }\n return wrapper;\n}\n\nfunction addAGlyph(glyph, where) {\n let title = \"\";\n if (glyph.name) {\n title = \"name: \" + glyph.name;\n }\n let cp =\n \"
U+\" +\n glyph.string.charCodeAt(0).toString(16).padStart(4, \"0\").toUpperCase();\n where.append(`\n
\n ${glyph.string}\n
\n\t\t${cp}\n
\n
\n `);\n}\n\nfunction addAWord(diff, where) {\n if (!diff.buffer_b) {\n diff.buffer_b = diff.buffer_a;\n }\n where.append(`\n\t\t
\n\t\t${\n diff.buffer_a\n }After:
${diff.buffer_b}

difference: ${\n Math.round(diff.percent * 100) / 100\n }%\">\n\t\t${diff.word}\n\t\t
\n\t\t
\n\t`);\n}\n\nfunction diffTables(report) {\n $(\"#difftable\").empty();\n $(\"#difftable\").append(`

Table-level details

`);\n $(\"#difftable\").append(\n renderTableDiff({ tables: report[\"tables\"] }, true).children()\n );\n $(\"#difftable .node\").on(\"click\", function (e) {\n $(this).toggleClass(\"closed open\");\n $(this).children(\".node\").toggle();\n e.stopPropagation();\n });\n}\n\nfunction cmapDiff(report) {\n if (report.cmap_diff && (report.cmap_diff.new || report.cmap_diff.missing)) {\n $(\"#cmapdiff\").append(\n `

Added and Removed Encoded Glyphs

`\n );\n if (report[\"cmap_diff\"][\"new\"]) {\n $(\"#cmapdiff\").append(`

Added Glyphs

`);\n let added = $(\"
\");\n for (let glyph of report[\"cmap_diff\"][\"new\"]) {\n addAGlyph(glyph, added);\n }\n $(\"#cmapdiff\").append(added);\n }\n\n if (report[\"cmap_diff\"][\"missing\"]) {\n $(\"#cmapdiff\").append(`

Removed Glyphs

`);\n let missing = $(\"
\");\n for (let glyph of report[\"cmap_diff\"][\"missing\"]) {\n addAGlyph(glyph, missing);\n }\n $(\"#cmapdiff\").append(missing);\n }\n } else {\n $(\"#cmapdiff\").append(`

No changes to encoded glyphs

`);\n }\n}\n\nfunction setupAnimation() {\n $(\"#fonttoggle\").click(function () {\n if ($(this).text() == \"Old\") {\n $(this).text(\"New\");\n $(\".font-before\").removeClass(\"font-before\").addClass(\"font-after\");\n } else {\n $(this).text(\"Old\");\n $(\".font-after\").removeClass(\"font-after\").addClass(\"font-before\");\n }\n });\n\n let animationHandle;\n function animate() {\n $(\"#fonttoggle\").click();\n animationHandle = setTimeout(animate, 1000);\n }\n $(\"#fontanimate\").click(function () {\n if ($(this).text() == \"Animate\") {\n $(this).text(\"Stop\");\n animate();\n } else {\n $(this).text(\"Animate\");\n clearTimeout(animationHandle);\n }\n });\n}\n\n\n\n\n//# sourceURL=webpack:///../src/templates/shared.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"renderTableDiff\", function() { return renderTableDiff; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addAGlyph\", function() { return addAGlyph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addAWord\", function() { return addAWord; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cmapDiff\", function() { return cmapDiff; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diffTables\", function() { return diffTables; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diffKerns\", function() { return diffKerns; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setupAnimation\", function() { return setupAnimation; });\nfunction renderTableDiff(node, toplevel) {\n var wrapper = $(\"
\");\n if (!node) {\n return wrapper;\n }\n if (Array.isArray(node) && node.length == 2) {\n var before = $(\"\");\n before.addClass(\"attr-before\");\n before.html(\" \" + node[0] + \" \");\n var after = $(\"\");\n after.addClass(\"attr-after\");\n after.append(renderTableDiff(node[1], true).children());\n wrapper.append(before);\n wrapper.append(after);\n return wrapper;\n }\n if (node.constructor != Object) {\n var thing = $(\"\");\n thing.html(node);\n wrapper.append(thing);\n return wrapper;\n }\n for (const [key, value] of Object.entries(node)) {\n var display = $(\"
\");\n display.addClass(\"node\");\n if (!toplevel) {\n display.hide();\n }\n display.append(key);\n display.append(renderTableDiff(value, false).children());\n if (display.children(\".node\").length > 0) {\n display.addClass(\"closed\");\n }\n wrapper.append(display);\n }\n return wrapper;\n}\n\nfunction addAGlyph(glyph, where) {\n let title = \"\";\n if (glyph.name) {\n title = \"name: \" + glyph.name;\n }\n let cp =\n \"
U+\" +\n glyph.string.codePointAt(0).toString(16).padStart(4, \"0\").toUpperCase();\n where.append(`\n
\n ${glyph.string}\n
\n\t\t${cp}\n
\n
\n `);\n}\n\nfunction addAWord(diff, where) {\n if (!diff.buffer_b) {\n diff.buffer_b = diff.buffer_a;\n }\n where.append(`\n\t\t
\n\t\t${\n diff.buffer_a\n }After:
${diff.buffer_b}

difference: ${\n Math.round(diff.percent * 100) / 100\n }%\">\n\t\t${diff.word}\n\t\t
\n\t\t
\n\t`);\n}\n\nfunction diffTables(report) {\n $(\"#difftable\").empty();\n $(\"#difftable\").append(`

Table-level details

`);\n $(\"#difftable\").append(\n renderTableDiff({ tables: report[\"tables\"] }, true).children()\n );\n $(\"#difftable .node\").on(\"click\", function (e) {\n $(this).toggleClass(\"closed open\");\n $(this).children(\".node\").toggle();\n e.stopPropagation();\n });\n}\n\nfunction diffKerns(report) {\n $(\"#diffkerns\").empty();\n $(\"#diffkerns\").append(`

Modified Kerns

`);\n $(\"#diffkerns\").append(\n `
PairOldNew
`\n );\n for (let [pair, value] of Object.entries(report[\"kerns\"])) {\n let row = $(\"\");\n row.append(`${pair}`);\n row.append(`${value[0]}`);\n row.append(`${value[1]}`);\n $(\"#diffkerns table\").append(row);\n }\n}\n\nfunction cmapDiff(report) {\n if (report.cmap_diff && (report.cmap_diff.new || report.cmap_diff.missing)) {\n $(\"#cmapdiff\").append(\n `

Added and Removed Encoded Glyphs

`\n );\n if (report[\"cmap_diff\"][\"new\"]) {\n $(\"#cmapdiff\").append(`

Added Glyphs

`);\n let added = $(\"
\");\n for (let glyph of report[\"cmap_diff\"][\"new\"]) {\n addAGlyph(glyph, added);\n }\n $(\"#cmapdiff\").append(added);\n }\n\n if (report[\"cmap_diff\"][\"missing\"]) {\n $(\"#cmapdiff\").append(`

Removed Glyphs

`);\n let missing = $(\"
\");\n for (let glyph of report[\"cmap_diff\"][\"missing\"]) {\n addAGlyph(glyph, missing);\n }\n $(\"#cmapdiff\").append(missing);\n }\n } else {\n $(\"#cmapdiff\").append(`

No changes to encoded glyphs

`);\n }\n}\n\nfunction setupAnimation() {\n $(\"#fonttoggle\").click(function () {\n if ($(this).text() == \"Old\") {\n $(this).text(\"New\");\n $(\".font-before\").removeClass(\"font-before\").addClass(\"font-after\");\n } else {\n $(this).text(\"Old\");\n $(\".font-after\").removeClass(\"font-after\").addClass(\"font-before\");\n }\n });\n\n let animationHandle;\n function animate() {\n $(\"#fonttoggle\").click();\n animationHandle = setTimeout(animate, 1000);\n }\n $(\"#fontanimate\").click(function () {\n if ($(this).text() == \"Animate\") {\n $(this).text(\"Stop\");\n animate();\n } else {\n $(this).text(\"Animate\");\n clearTimeout(animationHandle);\n }\n });\n}\n\n\n\n\n//# sourceURL=webpack:///../src/templates/shared.js?"); /***/ }), @@ -20,7 +20,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var worker_loader_webworker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! worker-loader!./webworker.js */ \"./node_modules/worker-loader/dist/cjs.js!./webworker.js\");\n/* harmony import */ var _src_templates_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../src/templates/shared */ \"../src/templates/shared.js\");\n\nconst diffWorker = new worker_loader_webworker_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n\n\n\njQuery.fn.shake = function (interval, distance, times) {\n interval = typeof interval == \"undefined\" ? 100 : interval;\n distance = typeof distance == \"undefined\" ? 10 : distance;\n times = typeof times == \"undefined\" ? 3 : times;\n var jTarget = $(this);\n jTarget.css(\"position\", \"relative\");\n for (var iter = 0; iter < times + 1; iter++) {\n jTarget.animate(\n {\n left: iter % 2 == 0 ? distance : distance * -1,\n },\n interval\n );\n }\n return jTarget.animate(\n {\n left: 0,\n },\n interval\n );\n};\n\nclass Diffenator {\n constructor() {\n this.beforeFont = null;\n this.afterFont = null;\n }\n\n get beforeCssStyle() {\n return document.styleSheets[0].cssRules[0].style;\n }\n get afterCssStyle() {\n return document.styleSheets[0].cssRules[1].style;\n }\n\n setVariationStyle(variations) {\n let rule = document.styleSheets[0].cssRules[2].style;\n rule.setProperty(\"font-variation-settings\", variations);\n }\n\n dropFile(files, element) {\n if (!files[0].name.match(/\\.[ot]tf$/i)) {\n $(element).shake();\n return;\n }\n var style;\n if (element.id == \"fontbefore\") {\n style = this.beforeCssStyle;\n $(element).find(\"h2\").addClass(\"font-before\");\n } else {\n style = this.afterCssStyle;\n $(element).find(\"h2\").addClass(\"font-after\");\n }\n window.thing = files[0];\n $(element).find(\"h2\").text(files[0].name);\n style.setProperty(\"src\", \"url(\" + URL.createObjectURL(files[0]) + \")\");\n var reader = new FileReader();\n let that = this;\n reader.onload = function (e) {\n let u8 = new Uint8Array(this.result);\n if (element.id == \"fontbefore\") {\n that.beforeFont = u8;\n } else {\n that.afterFont = u8;\n }\n if (that.beforeFont && that.afterFont) {\n that.letsDoThis();\n }\n };\n reader.readAsArrayBuffer(files[0]);\n }\n\n setVariations() {\n let cssSetting = $(\"#axes input\")\n .map(function () {\n return `\"${this.id.replace(\"axis-\", \"\")}\" ${this.value}`;\n })\n .get()\n .join(\", \");\n this.setVariationStyle(cssSetting);\n this.updateGlyphs();\n }\n\n setupAxes(message) {\n $(\"#axes\").empty();\n console.log(message);\n let { axes, instances } = message;\n for (var [tag, limits] of Object.entries(axes)) {\n console.log(tag, limits);\n let [axis_min, axis_def, axis_max] = limits;\n let axis = $(`
\n\t\t\t\t${tag}\n\t\t\t\t\n\t\t\t`);\n $(\"#axes\").append(axis);\n axis.on(\"input\", this.setVariations.bind(this));\n axis.on(\"change\", this.updateWords.bind(this));\n }\n if (Object.keys(instances).length > 0) {\n let select = $(\"\");\n for (var [name, location] of instances) {\n console.log(location);\n let location_str = Object.entries(location)\n .map(([k, v]) => `${k}=${v}`)\n .join(\",\");\n let option = $(``);\n select.append(option);\n }\n select.on(\"change\", function () {\n let location = $(this).val();\n let parts = location.split(\",\");\n for (let [i, part] of parts.entries()) {\n let [tag, value] = part.split(\"=\");\n console.log(tag, value);\n $(`#axis-${tag}`).val(value);\n }\n $(\"#axes input\").trigger(\"input\");\n $(\"#axes input\").trigger(\"change\");\n });\n $(\"#axes\").append(select);\n }\n }\n\n progress_callback(message) {\n console.log(\"Got json \", message);\n if (\"type\" in message && message.type == \"ready\") {\n $(\"#bigLoadingModal\").hide();\n $(\"#startModal\").show();\n } else if (message.type == \"axes\") {\n this.setupAxes(message); // Contains axes and named instances\n } else if (message.type == \"tables\") {\n // console.log(\"Hiding spinner\")\n $(\"#spinnerModal\").hide();\n Object(_src_templates_shared__WEBPACK_IMPORTED_MODULE_1__[\"diffTables\"])(message);\n } else if (message.type == \"modified_glyphs\") {\n $(\"#spinnerModal\").hide();\n let glyph_diff = message.modified_glyphs;\n this.renderGlyphDiff(glyph_diff);\n $(\".node\").on(\"click\", function (event) {\n $(this).children().toggle();\n event.stopPropagation();\n });\n } else if (message.type == \"new_missing_glyphs\") {\n $(\"#spinnerModal\").hide();\n this.renderCmapDiff(message);\n $(\".node\").on(\"click\", function (event) {\n $(this).children().toggle();\n event.stopPropagation();\n });\n } else if (message.type == \"words\") {\n $(\"#spinnerModal\").hide();\n $(\"#wordspinner\").hide();\n let diffs = message.words;\n for (var [script, words] of Object.entries(diffs)) {\n this.renderWordDiff(script, words);\n }\n }\n }\n\n variationLocation() {\n // Return the current axis location as a string of the form\n // tag=value,tag=value\n return $(\"#axes input\")\n .map(function () {\n return `${this.id.replace(\"axis-\", \"\")}=${this.value}`;\n })\n .get()\n .join(\",\");\n }\n\n letsDoThis() {\n $(\"#startModal\").hide();\n $(\"#spinnerModal\").show();\n diffWorker.postMessage({\n command: \"axes\",\n beforeFont: this.beforeFont,\n afterFont: this.afterFont,\n });\n diffWorker.postMessage({\n command: \"tables\",\n beforeFont: this.beforeFont,\n afterFont: this.afterFont,\n });\n diffWorker.postMessage({\n command: \"new_missing_glyphs\",\n beforeFont: this.beforeFont,\n afterFont: this.afterFont,\n });\n this.updateGlyphs();\n this.updateWords();\n }\n\n updateGlyphs() {\n let location = this.variationLocation();\n diffWorker.postMessage({\n command: \"modified_glyphs\",\n beforeFont: this.beforeFont,\n afterFont: this.afterFont,\n location,\n });\n }\n\n updateWords() {\n $(\"#wordspinner\").show();\n $(\"#worddiffinner\").empty();\n let location = this.variationLocation();\n diffWorker.postMessage({\n command: \"words\",\n beforeFont: this.beforeFont,\n afterFont: this.afterFont,\n location,\n });\n }\n\n renderCmapDiff(glyph_diff) {\n $(\"#cmapdiff\").empty();\n Object(_src_templates_shared__WEBPACK_IMPORTED_MODULE_1__[\"cmapDiff\"])(glyph_diff);\n $('[data-toggle=\"tooltip\"]').tooltip();\n }\n\n renderGlyphDiff(glyph_diff) {\n $(\"#glyphdiff\").empty();\n if (glyph_diff.length > 0) {\n $(\"#glyphdiff\").append($(`

Modified glyphs

`));\n let place = $('
');\n $(\"#glyphdiff\").append(place);\n\n glyph_diff.forEach((glyph) => {\n Object(_src_templates_shared__WEBPACK_IMPORTED_MODULE_1__[\"addAGlyph\"])(glyph, place);\n });\n $('[data-toggle=\"tooltip\"]').tooltip();\n }\n }\n\n renderWordDiff(script, diffs) {\n $(\"#worddiffinner\").append($(`
${script}
`));\n let place = $('
');\n $(\"#worddiffinner\").append(place);\n diffs.forEach((glyph) => {\n Object(_src_templates_shared__WEBPACK_IMPORTED_MODULE_1__[\"addAWord\"])(glyph, place);\n });\n $('[data-toggle=\"tooltip\"]').tooltip();\n }\n}\n\n$(function () {\n window.diffenator = new Diffenator();\n diffWorker.onmessage = (e) => window.diffenator.progress_callback(e.data);\n $(\"#bigLoadingModal\").show();\n\n $(\".fontdrop\").on(\"dragover dragenter\", function (e) {\n e.preventDefault();\n e.stopPropagation();\n $(this).addClass(\"dragging\");\n });\n $(\".fontdrop\").on(\"dragleave dragend\", function (e) {\n $(this).removeClass(\"dragging\");\n });\n\n $(\".fontdrop\").on(\"drop\", function (e) {\n $(this).removeClass(\"dragging\");\n if (\n e.originalEvent.dataTransfer &&\n e.originalEvent.dataTransfer.files.length\n ) {\n e.preventDefault();\n e.stopPropagation();\n diffenator.dropFile(e.originalEvent.dataTransfer.files, this);\n }\n });\n\n Object(_src_templates_shared__WEBPACK_IMPORTED_MODULE_1__[\"setupAnimation\"])();\n});\n\n\n//# sourceURL=webpack:///./index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var worker_loader_webworker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! worker-loader!./webworker.js */ \"./node_modules/worker-loader/dist/cjs.js!./webworker.js\");\n/* harmony import */ var _src_templates_shared__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../src/templates/shared */ \"../src/templates/shared.js\");\n\nconst diffWorker = new worker_loader_webworker_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n\n\n\njQuery.fn.shake = function (interval, distance, times) {\n interval = typeof interval == \"undefined\" ? 100 : interval;\n distance = typeof distance == \"undefined\" ? 10 : distance;\n times = typeof times == \"undefined\" ? 3 : times;\n var jTarget = $(this);\n jTarget.css(\"position\", \"relative\");\n for (var iter = 0; iter < times + 1; iter++) {\n jTarget.animate(\n {\n left: iter % 2 == 0 ? distance : distance * -1,\n },\n interval\n );\n }\n return jTarget.animate(\n {\n left: 0,\n },\n interval\n );\n};\n\nclass Diffenator {\n constructor() {\n this.beforeFont = null;\n this.afterFont = null;\n }\n\n get beforeCssStyle() {\n return document.styleSheets[0].cssRules[0].style;\n }\n get afterCssStyle() {\n return document.styleSheets[0].cssRules[1].style;\n }\n\n setVariationStyle(variations) {\n let rule = document.styleSheets[0].cssRules[2].style;\n rule.setProperty(\"font-variation-settings\", variations);\n }\n\n dropFile(files, element) {\n if (!files[0].name.match(/\\.[ot]tf$/i)) {\n $(element).shake();\n return;\n }\n var style;\n if (element.id == \"fontbefore\") {\n style = this.beforeCssStyle;\n $(element).find(\"h2\").addClass(\"font-before\");\n } else {\n style = this.afterCssStyle;\n $(element).find(\"h2\").addClass(\"font-after\");\n }\n window.thing = files[0];\n $(element).find(\"h2\").text(files[0].name);\n style.setProperty(\"src\", \"url(\" + URL.createObjectURL(files[0]) + \")\");\n var reader = new FileReader();\n let that = this;\n reader.onload = function (e) {\n let u8 = new Uint8Array(this.result);\n if (element.id == \"fontbefore\") {\n that.beforeFont = u8;\n } else {\n that.afterFont = u8;\n }\n if (that.beforeFont && that.afterFont) {\n that.letsDoThis();\n }\n };\n reader.readAsArrayBuffer(files[0]);\n }\n\n setVariations() {\n let cssSetting = $(\"#axes input\")\n .map(function () {\n return `\"${this.id.replace(\"axis-\", \"\")}\" ${this.value}`;\n })\n .get()\n .join(\", \");\n this.setVariationStyle(cssSetting);\n this.updateGlyphs();\n }\n\n setupAxes(message) {\n $(\"#axes\").empty();\n console.log(message);\n let { axes, instances } = message;\n for (var [tag, limits] of Object.entries(axes)) {\n console.log(tag, limits);\n let [axis_min, axis_def, axis_max] = limits;\n let axis = $(`
\n\t\t\t\t${tag}\n\t\t\t\t\n\t\t\t`);\n $(\"#axes\").append(axis);\n axis.on(\"input\", this.setVariations.bind(this));\n axis.on(\"change\", this.updateWords.bind(this));\n }\n if (Object.keys(instances).length > 0) {\n let select = $(\"\");\n for (var [name, location] of instances) {\n console.log(location);\n let location_str = Object.entries(location)\n .map(([k, v]) => `${k}=${v}`)\n .join(\",\");\n let option = $(``);\n select.append(option);\n }\n select.on(\"change\", function () {\n let location = $(this).val();\n let parts = location.split(\",\");\n for (let [i, part] of parts.entries()) {\n let [tag, value] = part.split(\"=\");\n console.log(tag, value);\n $(`#axis-${tag}`).val(value);\n }\n $(\"#axes input\").trigger(\"input\");\n $(\"#axes input\").trigger(\"change\");\n });\n $(\"#axes\").append(select);\n }\n }\n\n progress_callback(message) {\n console.log(\"Got json \", message);\n if (\"type\" in message && message.type == \"ready\") {\n $(\"#bigLoadingModal\").hide();\n $(\"#startModal\").show();\n } else if (message.type == \"axes\") {\n this.setupAxes(message); // Contains axes and named instances\n } else if (message.type == \"tables\") {\n // console.log(\"Hiding spinner\")\n $(\"#spinnerModal\").hide();\n Object(_src_templates_shared__WEBPACK_IMPORTED_MODULE_1__[\"diffTables\"])(message);\n } else if (message.type == \"kerns\") {\n // console.log(\"Hiding spinner\")\n $(\"#spinnerModal\").hide();\n Object(_src_templates_shared__WEBPACK_IMPORTED_MODULE_1__[\"diffKerns\"])(message);\n } else if (message.type == \"modified_glyphs\") {\n $(\"#spinnerModal\").hide();\n let glyph_diff = message.modified_glyphs;\n this.renderGlyphDiff(glyph_diff);\n $(\".node\").on(\"click\", function (event) {\n $(this).children().toggle();\n event.stopPropagation();\n });\n } else if (message.type == \"new_missing_glyphs\") {\n $(\"#spinnerModal\").hide();\n this.renderCmapDiff(message);\n $(\".node\").on(\"click\", function (event) {\n $(this).children().toggle();\n event.stopPropagation();\n });\n } else if (message.type == \"words\") {\n $(\"#spinnerModal\").hide();\n $(\"#wordspinner\").hide();\n let diffs = message.words;\n for (var [script, words] of Object.entries(diffs)) {\n this.renderWordDiff(script, words);\n }\n }\n }\n\n variationLocation() {\n // Return the current axis location as a string of the form\n // tag=value,tag=value\n return $(\"#axes input\")\n .map(function () {\n return `${this.id.replace(\"axis-\", \"\")}=${this.value}`;\n })\n .get()\n .join(\",\");\n }\n\n letsDoThis() {\n $(\"#startModal\").hide();\n $(\"#spinnerModal\").show();\n diffWorker.postMessage({\n command: \"axes\",\n beforeFont: this.beforeFont,\n afterFont: this.afterFont,\n });\n diffWorker.postMessage({\n command: \"tables\",\n beforeFont: this.beforeFont,\n afterFont: this.afterFont,\n });\n diffWorker.postMessage({\n command: \"kerns\",\n beforeFont: this.beforeFont,\n afterFont: this.afterFont,\n });\n diffWorker.postMessage({\n command: \"new_missing_glyphs\",\n beforeFont: this.beforeFont,\n afterFont: this.afterFont,\n });\n this.updateGlyphs();\n this.updateWords();\n }\n\n updateGlyphs() {\n let location = this.variationLocation();\n diffWorker.postMessage({\n command: \"modified_glyphs\",\n beforeFont: this.beforeFont,\n afterFont: this.afterFont,\n location,\n });\n }\n\n updateWords() {\n $(\"#wordspinner\").show();\n $(\"#worddiffinner\").empty();\n let location = this.variationLocation();\n diffWorker.postMessage({\n command: \"words\",\n beforeFont: this.beforeFont,\n afterFont: this.afterFont,\n location,\n });\n }\n\n renderCmapDiff(glyph_diff) {\n $(\"#cmapdiff\").empty();\n Object(_src_templates_shared__WEBPACK_IMPORTED_MODULE_1__[\"cmapDiff\"])(glyph_diff);\n $('[data-toggle=\"tooltip\"]').tooltip();\n }\n\n renderGlyphDiff(glyph_diff) {\n $(\"#glyphdiff\").empty();\n if (glyph_diff.length > 0) {\n $(\"#glyphdiff\").append($(`

Modified glyphs

`));\n let place = $('
');\n $(\"#glyphdiff\").append(place);\n\n glyph_diff.forEach((glyph) => {\n Object(_src_templates_shared__WEBPACK_IMPORTED_MODULE_1__[\"addAGlyph\"])(glyph, place);\n });\n $('[data-toggle=\"tooltip\"]').tooltip();\n }\n }\n\n renderWordDiff(script, diffs) {\n $(\"#worddiffinner\").append($(`
${script}
`));\n let place = $('
');\n $(\"#worddiffinner\").append(place);\n diffs.forEach((glyph) => {\n Object(_src_templates_shared__WEBPACK_IMPORTED_MODULE_1__[\"addAWord\"])(glyph, place);\n });\n $('[data-toggle=\"tooltip\"]').tooltip();\n }\n}\n\n$(function () {\n window.diffenator = new Diffenator();\n diffWorker.onmessage = (e) => window.diffenator.progress_callback(e.data);\n $(\"#bigLoadingModal\").show();\n\n $(\".fontdrop\").on(\"dragover dragenter\", function (e) {\n e.preventDefault();\n e.stopPropagation();\n $(this).addClass(\"dragging\");\n });\n $(\".fontdrop\").on(\"dragleave dragend\", function (e) {\n $(this).removeClass(\"dragging\");\n });\n\n $(\".fontdrop\").on(\"drop\", function (e) {\n $(this).removeClass(\"dragging\");\n if (\n e.originalEvent.dataTransfer &&\n e.originalEvent.dataTransfer.files.length\n ) {\n e.preventDefault();\n e.stopPropagation();\n diffenator.dropFile(e.originalEvent.dataTransfer.files, this);\n }\n });\n\n Object(_src_templates_shared__WEBPACK_IMPORTED_MODULE_1__[\"setupAnimation\"])();\n});\n\n\n//# sourceURL=webpack:///./index.js?"); /***/ }), diff --git a/docs/0.bootstrap.worker.js b/docs/0.bootstrap.worker.js index 5a2e00e..e706fc2 100644 --- a/docs/0.bootstrap.worker.js +++ b/docs/0.bootstrap.worker.js @@ -4,11 +4,11 @@ self["webpackChunk"]([0],{ /*!*****************************!*\ !*** ../pkg/diffenator3.js ***! \*****************************/ -/*! exports provided: __wbg_set_wasm, diff_words, new_missing_glyphs, modified_glyphs, diff_tables, axes, debugging, __wbindgen_object_drop_ref, __wbindgen_string_new, __wbg_call_89af060b4e1523f2, __wbg_new_abda76e883ba8a5f, __wbg_stack_658279fe44541cf6, __wbg_error_f851667af71bcfc6, __wbindgen_debug_string, __wbindgen_throw */ +/*! exports provided: __wbg_set_wasm, diff_words, new_missing_glyphs, modified_glyphs, diff_kerns, diff_tables, axes, debugging, __wbindgen_object_drop_ref, __wbindgen_string_new, __wbg_call_89af060b4e1523f2, __wbg_new_abda76e883ba8a5f, __wbg_stack_658279fe44541cf6, __wbg_error_f851667af71bcfc6, __wbindgen_debug_string, __wbindgen_throw */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _diffenator3_bg_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffenator3_bg.wasm */ \"../pkg/diffenator3_bg.wasm\");\n/* harmony import */ var _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./diffenator3_bg.js */ \"../pkg/diffenator3_bg.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbg_set_wasm\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_set_wasm\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"diff_words\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"diff_words\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"new_missing_glyphs\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"new_missing_glyphs\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"modified_glyphs\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"modified_glyphs\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"diff_tables\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"diff_tables\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"axes\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"axes\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"debugging\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"debugging\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_object_drop_ref\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbindgen_object_drop_ref\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_string_new\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbindgen_string_new\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbg_call_89af060b4e1523f2\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_call_89af060b4e1523f2\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_abda76e883ba8a5f\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_new_abda76e883ba8a5f\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbg_stack_658279fe44541cf6\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_stack_658279fe44541cf6\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbg_error_f851667af71bcfc6\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_error_f851667af71bcfc6\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_debug_string\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbindgen_debug_string\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_throw\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbindgen_throw\"]; });\n\n\n\n\nObject(_diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_set_wasm\"])(_diffenator3_bg_wasm__WEBPACK_IMPORTED_MODULE_0__);\n\n\n\n//# sourceURL=webpack:///../pkg/diffenator3.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _diffenator3_bg_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffenator3_bg.wasm */ \"../pkg/diffenator3_bg.wasm\");\n/* harmony import */ var _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./diffenator3_bg.js */ \"../pkg/diffenator3_bg.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbg_set_wasm\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_set_wasm\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"diff_words\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"diff_words\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"new_missing_glyphs\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"new_missing_glyphs\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"modified_glyphs\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"modified_glyphs\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"diff_kerns\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"diff_kerns\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"diff_tables\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"diff_tables\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"axes\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"axes\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"debugging\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"debugging\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_object_drop_ref\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbindgen_object_drop_ref\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_string_new\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbindgen_string_new\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbg_call_89af060b4e1523f2\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_call_89af060b4e1523f2\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_abda76e883ba8a5f\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_new_abda76e883ba8a5f\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbg_stack_658279fe44541cf6\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_stack_658279fe44541cf6\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbg_error_f851667af71bcfc6\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_error_f851667af71bcfc6\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_debug_string\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbindgen_debug_string\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_throw\", function() { return _diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbindgen_throw\"]; });\n\n\n\n\nObject(_diffenator3_bg_js__WEBPACK_IMPORTED_MODULE_1__[\"__wbg_set_wasm\"])(_diffenator3_bg_wasm__WEBPACK_IMPORTED_MODULE_0__);\n\n\n\n//# sourceURL=webpack:///../pkg/diffenator3.js?"); /***/ }), @@ -16,11 +16,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dif /*!********************************!*\ !*** ../pkg/diffenator3_bg.js ***! \********************************/ -/*! exports provided: __wbg_set_wasm, diff_words, new_missing_glyphs, modified_glyphs, diff_tables, axes, debugging, __wbindgen_object_drop_ref, __wbindgen_string_new, __wbg_call_89af060b4e1523f2, __wbg_new_abda76e883ba8a5f, __wbg_stack_658279fe44541cf6, __wbg_error_f851667af71bcfc6, __wbindgen_debug_string, __wbindgen_throw */ +/*! exports provided: __wbg_set_wasm, diff_words, new_missing_glyphs, modified_glyphs, diff_kerns, diff_tables, axes, debugging, __wbindgen_object_drop_ref, __wbindgen_string_new, __wbg_call_89af060b4e1523f2, __wbg_new_abda76e883ba8a5f, __wbg_stack_658279fe44541cf6, __wbg_error_f851667af71bcfc6, __wbindgen_debug_string, __wbindgen_throw */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_set_wasm\", function() { return __wbg_set_wasm; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diff_words\", function() { return diff_words; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"new_missing_glyphs\", function() { return new_missing_glyphs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modified_glyphs\", function() { return modified_glyphs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diff_tables\", function() { return diff_tables; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"axes\", function() { return axes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"debugging\", function() { return debugging; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_object_drop_ref\", function() { return __wbindgen_object_drop_ref; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_string_new\", function() { return __wbindgen_string_new; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_call_89af060b4e1523f2\", function() { return __wbg_call_89af060b4e1523f2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_abda76e883ba8a5f\", function() { return __wbg_new_abda76e883ba8a5f; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_stack_658279fe44541cf6\", function() { return __wbg_stack_658279fe44541cf6; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_error_f851667af71bcfc6\", function() { return __wbg_error_f851667af71bcfc6; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_debug_string\", function() { return __wbindgen_debug_string; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_throw\", function() { return __wbindgen_throw; });\nlet wasm;\nfunction __wbg_set_wasm(val) {\n wasm = val;\n}\n\n\nconst heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nfunction getObject(idx) { return heap[idx]; }\n\nlet heap_next = heap.length;\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n\nconst lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;\n\nlet cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nfunction debugString(val) {\n // primitive types\n const type = typeof val;\n if (type == 'number' || type == 'boolean' || val == null) {\n return `${val}`;\n }\n if (type == 'string') {\n return `\"${val}\"`;\n }\n if (type == 'symbol') {\n const description = val.description;\n if (description == null) {\n return 'Symbol';\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == 'function') {\n const name = val.name;\n if (typeof name == 'string' && name.length > 0) {\n return `Function(${name})`;\n } else {\n return 'Function';\n }\n }\n // objects\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = '[';\n if (length > 0) {\n debug += debugString(val[0]);\n }\n for(let i = 1; i < length; i++) {\n debug += ', ' + debugString(val[i]);\n }\n debug += ']';\n return debug;\n }\n // Test for built-in\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n // Failed to match the standard '[object ClassName]'\n return toString.call(val);\n }\n if (className == 'Object') {\n // we're a user defined class or Object\n // JSON.stringify avoids problems with cycles, and is generally much\n // easier than looping through ownProperties of `val`.\n try {\n return 'Object(' + JSON.stringify(val) + ')';\n } catch (_) {\n return 'Object';\n }\n }\n // errors\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\\n${val.stack}`;\n }\n // TODO we could test for more things here, like `Set`s and `Map`s.\n return className;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;\n\nlet cachedTextEncoder = new lTextEncoder('utf-8');\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nfunction passArray8ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 1, 1) >>> 0;\n getUint8ArrayMemory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nlet stack_pointer = 128;\n\nfunction addBorrowedObject(obj) {\n if (stack_pointer == 1) throw new Error('out of js stack');\n heap[--stack_pointer] = obj;\n return stack_pointer;\n}\n/**\n* @param {Uint8Array} font_a\n* @param {Uint8Array} font_b\n* @param {string} location\n* @param {Function} f\n*/\nfunction diff_words(font_a, font_b, location, f) {\n try {\n const ptr0 = passArray8ToWasm0(font_a, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(font_b, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len2 = WASM_VECTOR_LEN;\n wasm.diff_words(ptr0, len0, ptr1, len1, ptr2, len2, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n}\n\n/**\n* @param {Uint8Array} font_a\n* @param {Uint8Array} font_b\n* @param {Function} f\n*/\nfunction new_missing_glyphs(font_a, font_b, f) {\n try {\n const ptr0 = passArray8ToWasm0(font_a, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(font_b, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n wasm.new_missing_glyphs(ptr0, len0, ptr1, len1, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n}\n\n/**\n* @param {Uint8Array} font_a\n* @param {Uint8Array} font_b\n* @param {string} location\n* @param {Function} f\n*/\nfunction modified_glyphs(font_a, font_b, location, f) {\n try {\n const ptr0 = passArray8ToWasm0(font_a, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(font_b, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len2 = WASM_VECTOR_LEN;\n wasm.modified_glyphs(ptr0, len0, ptr1, len1, ptr2, len2, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n}\n\n/**\n* @param {Uint8Array} font_a\n* @param {Uint8Array} font_b\n* @param {Function} f\n*/\nfunction diff_tables(font_a, font_b, f) {\n try {\n const ptr0 = passArray8ToWasm0(font_a, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(font_b, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n wasm.diff_tables(ptr0, len0, ptr1, len1, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n}\n\n/**\n* @param {Uint8Array} font_a\n* @param {Uint8Array} font_b\n* @returns {string}\n*/\nfunction axes(font_a, font_b) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passArray8ToWasm0(font_a, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(font_b, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n wasm.axes(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n*/\nfunction debugging() {\n wasm.debugging();\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n wasm.__wbindgen_exn_store(addHeapObject(e));\n }\n}\n\nfunction __wbindgen_object_drop_ref(arg0) {\n takeObject(arg0);\n};\n\nfunction __wbindgen_string_new(arg0, arg1) {\n const ret = getStringFromWasm0(arg0, arg1);\n return addHeapObject(ret);\n};\n\nfunction __wbg_call_89af060b4e1523f2() { return handleError(function (arg0, arg1, arg2) {\n const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));\n return addHeapObject(ret);\n}, arguments) };\n\nfunction __wbg_new_abda76e883ba8a5f() {\n const ret = new Error();\n return addHeapObject(ret);\n};\n\nfunction __wbg_stack_658279fe44541cf6(arg0, arg1) {\n const ret = getObject(arg1).stack;\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n};\n\nfunction __wbg_error_f851667af71bcfc6(arg0, arg1) {\n let deferred0_0;\n let deferred0_1;\n try {\n deferred0_0 = arg0;\n deferred0_1 = arg1;\n console.error(getStringFromWasm0(arg0, arg1));\n } finally {\n wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);\n }\n};\n\nfunction __wbindgen_debug_string(arg0, arg1) {\n const ret = debugString(getObject(arg1));\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n};\n\nfunction __wbindgen_throw(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../www/node_modules/webpack/buildin/harmony-module.js */ \"./node_modules/webpack/buildin/harmony-module.js\")(module)))\n\n//# sourceURL=webpack:///../pkg/diffenator3_bg.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_set_wasm\", function() { return __wbg_set_wasm; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diff_words\", function() { return diff_words; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"new_missing_glyphs\", function() { return new_missing_glyphs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modified_glyphs\", function() { return modified_glyphs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diff_kerns\", function() { return diff_kerns; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"diff_tables\", function() { return diff_tables; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"axes\", function() { return axes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"debugging\", function() { return debugging; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_object_drop_ref\", function() { return __wbindgen_object_drop_ref; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_string_new\", function() { return __wbindgen_string_new; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_call_89af060b4e1523f2\", function() { return __wbg_call_89af060b4e1523f2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_new_abda76e883ba8a5f\", function() { return __wbg_new_abda76e883ba8a5f; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_stack_658279fe44541cf6\", function() { return __wbg_stack_658279fe44541cf6; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_error_f851667af71bcfc6\", function() { return __wbg_error_f851667af71bcfc6; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_debug_string\", function() { return __wbindgen_debug_string; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_throw\", function() { return __wbindgen_throw; });\nlet wasm;\nfunction __wbg_set_wasm(val) {\n wasm = val;\n}\n\n\nconst heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nfunction getObject(idx) { return heap[idx]; }\n\nlet heap_next = heap.length;\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n\nconst lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;\n\nlet cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));\n}\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nfunction debugString(val) {\n // primitive types\n const type = typeof val;\n if (type == 'number' || type == 'boolean' || val == null) {\n return `${val}`;\n }\n if (type == 'string') {\n return `\"${val}\"`;\n }\n if (type == 'symbol') {\n const description = val.description;\n if (description == null) {\n return 'Symbol';\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == 'function') {\n const name = val.name;\n if (typeof name == 'string' && name.length > 0) {\n return `Function(${name})`;\n } else {\n return 'Function';\n }\n }\n // objects\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = '[';\n if (length > 0) {\n debug += debugString(val[0]);\n }\n for(let i = 1; i < length; i++) {\n debug += ', ' + debugString(val[i]);\n }\n debug += ']';\n return debug;\n }\n // Test for built-in\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n // Failed to match the standard '[object ClassName]'\n return toString.call(val);\n }\n if (className == 'Object') {\n // we're a user defined class or Object\n // JSON.stringify avoids problems with cycles, and is generally much\n // easier than looping through ownProperties of `val`.\n try {\n return 'Object(' + JSON.stringify(val) + ')';\n } catch (_) {\n return 'Object';\n }\n }\n // errors\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\\n${val.stack}`;\n }\n // TODO we could test for more things here, like `Set`s and `Map`s.\n return className;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;\n\nlet cachedTextEncoder = new lTextEncoder('utf-8');\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nfunction passArray8ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 1, 1) >>> 0;\n getUint8ArrayMemory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n\nlet stack_pointer = 128;\n\nfunction addBorrowedObject(obj) {\n if (stack_pointer == 1) throw new Error('out of js stack');\n heap[--stack_pointer] = obj;\n return stack_pointer;\n}\n/**\n* @param {Uint8Array} font_a\n* @param {Uint8Array} font_b\n* @param {string} location\n* @param {Function} f\n*/\nfunction diff_words(font_a, font_b, location, f) {\n try {\n const ptr0 = passArray8ToWasm0(font_a, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(font_b, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len2 = WASM_VECTOR_LEN;\n wasm.diff_words(ptr0, len0, ptr1, len1, ptr2, len2, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n}\n\n/**\n* @param {Uint8Array} font_a\n* @param {Uint8Array} font_b\n* @param {Function} f\n*/\nfunction new_missing_glyphs(font_a, font_b, f) {\n try {\n const ptr0 = passArray8ToWasm0(font_a, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(font_b, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n wasm.new_missing_glyphs(ptr0, len0, ptr1, len1, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n}\n\n/**\n* @param {Uint8Array} font_a\n* @param {Uint8Array} font_b\n* @param {string} location\n* @param {Function} f\n*/\nfunction modified_glyphs(font_a, font_b, location, f) {\n try {\n const ptr0 = passArray8ToWasm0(font_a, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(font_b, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n const ptr2 = passStringToWasm0(location, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len2 = WASM_VECTOR_LEN;\n wasm.modified_glyphs(ptr0, len0, ptr1, len1, ptr2, len2, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n}\n\n/**\n* @param {Uint8Array} font_a\n* @param {Uint8Array} font_b\n* @param {Function} f\n*/\nfunction diff_kerns(font_a, font_b, f) {\n try {\n const ptr0 = passArray8ToWasm0(font_a, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(font_b, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n wasm.diff_kerns(ptr0, len0, ptr1, len1, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n}\n\n/**\n* @param {Uint8Array} font_a\n* @param {Uint8Array} font_b\n* @param {Function} f\n*/\nfunction diff_tables(font_a, font_b, f) {\n try {\n const ptr0 = passArray8ToWasm0(font_a, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(font_b, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n wasm.diff_tables(ptr0, len0, ptr1, len1, addBorrowedObject(f));\n } finally {\n heap[stack_pointer++] = undefined;\n }\n}\n\n/**\n* @param {Uint8Array} font_a\n* @param {Uint8Array} font_b\n* @returns {string}\n*/\nfunction axes(font_a, font_b) {\n let deferred3_0;\n let deferred3_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passArray8ToWasm0(font_a, wasm.__wbindgen_malloc);\n const len0 = WASM_VECTOR_LEN;\n const ptr1 = passArray8ToWasm0(font_b, wasm.__wbindgen_malloc);\n const len1 = WASM_VECTOR_LEN;\n wasm.axes(retptr, ptr0, len0, ptr1, len1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred3_0 = r0;\n deferred3_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);\n }\n}\n\n/**\n*/\nfunction debugging() {\n wasm.debugging();\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n wasm.__wbindgen_exn_store(addHeapObject(e));\n }\n}\n\nfunction __wbindgen_object_drop_ref(arg0) {\n takeObject(arg0);\n};\n\nfunction __wbindgen_string_new(arg0, arg1) {\n const ret = getStringFromWasm0(arg0, arg1);\n return addHeapObject(ret);\n};\n\nfunction __wbg_call_89af060b4e1523f2() { return handleError(function (arg0, arg1, arg2) {\n const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));\n return addHeapObject(ret);\n}, arguments) };\n\nfunction __wbg_new_abda76e883ba8a5f() {\n const ret = new Error();\n return addHeapObject(ret);\n};\n\nfunction __wbg_stack_658279fe44541cf6(arg0, arg1) {\n const ret = getObject(arg1).stack;\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n};\n\nfunction __wbg_error_f851667af71bcfc6(arg0, arg1) {\n let deferred0_0;\n let deferred0_1;\n try {\n deferred0_0 = arg0;\n deferred0_1 = arg1;\n console.error(getStringFromWasm0(arg0, arg1));\n } finally {\n wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);\n }\n};\n\nfunction __wbindgen_debug_string(arg0, arg1) {\n const ret = debugString(getObject(arg1));\n const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len1 = WASM_VECTOR_LEN;\n getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);\n getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);\n};\n\nfunction __wbindgen_throw(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../www/node_modules/webpack/buildin/harmony-module.js */ \"./node_modules/webpack/buildin/harmony-module.js\")(module)))\n\n//# sourceURL=webpack:///../pkg/diffenator3_bg.js?"); /***/ }), @@ -28,7 +28,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(f /*!**********************************!*\ !*** ../pkg/diffenator3_bg.wasm ***! \**********************************/ -/*! exports provided: memory, diff_words, new_missing_glyphs, modified_glyphs, diff_tables, axes, debugging, __wbindgen_malloc, __wbindgen_realloc, __wbindgen_add_to_stack_pointer, __wbindgen_free, __wbindgen_exn_store */ +/*! exports provided: memory, diff_words, new_missing_glyphs, modified_glyphs, diff_kerns, diff_tables, axes, debugging, __wbindgen_malloc, __wbindgen_realloc, __wbindgen_add_to_stack_pointer, __wbindgen_free, __wbindgen_exn_store */ /***/ (function(module, exports, __webpack_require__) { eval("\"use strict\";\n// Instantiate WebAssembly module\nvar wasmExports = __webpack_require__.w[module.i];\n__webpack_require__.r(exports);\n// export exports from WebAssembly module\nfor(var name in wasmExports) if(name != \"__webpack_init__\") exports[name] = wasmExports[name];\n// exec imports from WebAssembly module (for esm order)\n/* harmony import */ var m0 = __webpack_require__(/*! ./diffenator3_bg.js */ \"../pkg/diffenator3_bg.js\");\n\n\n// exec wasm module\nwasmExports[\"__webpack_init__\"]()\n\n//# sourceURL=webpack:///../pkg/diffenator3_bg.wasm?"); diff --git a/docs/2434fe2832961cde9403.module.wasm b/docs/2434fe2832961cde9403.module.wasm new file mode 100644 index 0000000..826e0c7 Binary files /dev/null and b/docs/2434fe2832961cde9403.module.wasm differ diff --git a/docs/9de20aab78b15cea8870.module.wasm b/docs/9de20aab78b15cea8870.module.wasm new file mode 100644 index 0000000..1821d0a Binary files /dev/null and b/docs/9de20aab78b15cea8870.module.wasm differ diff --git a/docs/bootstrap.worker.js b/docs/bootstrap.worker.js index 3946aeb..80a7bad 100644 --- a/docs/bootstrap.worker.js +++ b/docs/bootstrap.worker.js @@ -101,7 +101,7 @@ /******/ promises.push(installedWasmModuleData); /******/ else { /******/ var importObject = wasmImportObjects[wasmModuleId](); -/******/ var req = fetch(__webpack_require__.p + "" + {"../pkg/diffenator3_bg.wasm":"fd5dd7b693de39dfe6b0"}[wasmModuleId] + ".module.wasm"); +/******/ var req = fetch(__webpack_require__.p + "" + {"../pkg/diffenator3_bg.wasm":"9de20aab78b15cea8870"}[wasmModuleId] + ".module.wasm"); /******/ var promise; /******/ if(importObject instanceof Promise && typeof WebAssembly.compileStreaming === 'function') { /******/ promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) { @@ -192,7 +192,7 @@ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var module = __webpack_require__.e(/*! import() */ 0).then(__webpack_require__.bind(null, /*! ../pkg/diffenator3.js */ \"../pkg/diffenator3.js\"));\nasync function init() {\n let wasm = await module;\n self.postMessage({ type: \"ready\" });\n // console.log(\"Got wasm module\", wasm);\n wasm.debugging();\n self.onmessage = async (event) => {\n // console.log(\"Worker received message\");\n // console.log(event);\n const { command, beforeFont, location, afterFont } = event.data;\n if (command == \"axes\") {\n let obj = JSON.parse(wasm.axes(beforeFont, afterFont));\n obj[\"type\"] = \"axes\";\n self.postMessage(obj);\n } else if (command == \"tables\") {\n wasm.diff_tables(beforeFont, afterFont, (tables) => {\n self.postMessage({\n type: \"tables\",\n tables: JSON.parse(tables)[\"tables\"],\n });\n });\n } else if (command == \"new_missing_glyphs\") {\n wasm.new_missing_glyphs(beforeFont, afterFont, (new_missing_glyphs) => {\n self.postMessage({\n type: \"new_missing_glyphs\",\n cmap_diff: JSON.parse(new_missing_glyphs)[\"new_missing_glyphs\"],\n });\n });\n } else if (command == \"modified_glyphs\") {\n wasm.modified_glyphs(beforeFont, afterFont, location, (glyphs) => {\n self.postMessage({\n type: \"modified_glyphs\",\n modified_glyphs: JSON.parse(glyphs)[\"modified_glyphs\"],\n });\n });\n } else if (command == \"words\") {\n wasm.diff_words(beforeFont, afterFont, location, (words) => {\n self.postMessage({\n type: \"words\",\n words: JSON.parse(words)[\"words\"],\n });\n });\n }\n };\n return self;\n}\n\ninit();\n\n\n//# sourceURL=webpack:///./webworker.js?"); +eval("var module = __webpack_require__.e(/*! import() */ 0).then(__webpack_require__.bind(null, /*! ../pkg/diffenator3.js */ \"../pkg/diffenator3.js\"));\nasync function init() {\n let wasm = await module;\n self.postMessage({ type: \"ready\" });\n // console.log(\"Got wasm module\", wasm);\n wasm.debugging();\n self.onmessage = async (event) => {\n // console.log(\"Worker received message\");\n // console.log(event);\n const { command, beforeFont, location, afterFont } = event.data;\n if (command == \"axes\") {\n let obj = JSON.parse(wasm.axes(beforeFont, afterFont));\n obj[\"type\"] = \"axes\";\n self.postMessage(obj);\n } else if (command == \"tables\") {\n wasm.diff_tables(beforeFont, afterFont, (tables) => {\n self.postMessage({\n type: \"tables\",\n tables: JSON.parse(tables)[\"tables\"],\n });\n });\n } else if (command == \"kerns\") {\n wasm.diff_kerns(beforeFont, afterFont, (kerns) => {\n self.postMessage({\n type: \"kerns\",\n kerns: JSON.parse(kerns)[\"kerns\"],\n });\n });\n } else if (command == \"new_missing_glyphs\") {\n wasm.new_missing_glyphs(beforeFont, afterFont, (new_missing_glyphs) => {\n self.postMessage({\n type: \"new_missing_glyphs\",\n cmap_diff: JSON.parse(new_missing_glyphs)[\"new_missing_glyphs\"],\n });\n });\n } else if (command == \"modified_glyphs\") {\n wasm.modified_glyphs(beforeFont, afterFont, location, (glyphs) => {\n self.postMessage({\n type: \"modified_glyphs\",\n modified_glyphs: JSON.parse(glyphs)[\"modified_glyphs\"],\n });\n });\n } else if (command == \"words\") {\n wasm.diff_words(beforeFont, afterFont, location, (words) => {\n self.postMessage({\n type: \"words\",\n words: JSON.parse(words)[\"words\"],\n });\n });\n }\n };\n return self;\n}\n\ninit();\n\n\n//# sourceURL=webpack:///./webworker.js?"); /***/ }) diff --git a/docs/ca16e279e92094df1758.module.wasm b/docs/ca16e279e92094df1758.module.wasm new file mode 100644 index 0000000..b59fd82 Binary files /dev/null and b/docs/ca16e279e92094df1758.module.wasm differ diff --git a/docs/index.html b/docs/index.html index f1f02c9..ce92bc9 100644 --- a/docs/index.html +++ b/docs/index.html @@ -107,6 +107,7 @@

Modified Words

+
diff --git a/docs/style.css b/docs/style.css index 30b3afc..a8a3737 100644 --- a/docs/style.css +++ b/docs/style.css @@ -93,12 +93,12 @@ body { } .attr-before { - color: red; + color: green; cursor: text; } .attr-after { - color: green; + color: red; cursor: text; }