diff --git a/lib/sequence-diagram.js b/lib/sequence-diagram.js index 51a964f..9cfcf96 100644 --- a/lib/sequence-diagram.js +++ b/lib/sequence-diagram.js @@ -11052,7 +11052,14 @@ const DEFAULT_FONT = 'sans-serif'; - const OPENTYPE_OPTIONS = {hinting: true}; + const OPENTYPE_OPTIONS = { + features: [ + {script: 'arab', tags: ['init', 'medi', 'fina', 'rlig']}, + {script: 'latn', tags: ['liga', 'rlig']}, + ], + hinting: true, + kerning: true, + }; function getFont(attrs) { const family = (attrs['font-family'] || DEFAULT_FONT).split(','); diff --git a/package-lock.json b/package-lock.json index b7b6e52..beb3e9b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4269,9 +4269,9 @@ } }, "opentype.js": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/opentype.js/-/opentype.js-0.12.0.tgz", - "integrity": "sha512-xb0kQVqtNCtLo3iPjCdjaoK48KomcPl2tWK6Fdja25CqwWTyYjpgK1ggb/ioXOzCArkcGzVC3Sts5t0mZSTAqw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/opentype.js/-/opentype.js-1.1.0.tgz", + "integrity": "sha512-SZimNGuUYrsGPk/nNCaytsrCWDbG+YB+G9Mzc6BM5XiIsIQpkhZa1QvSmNa+eN9xr1n+kBnBJih5YLVBviaJQg==", "requires": { "string.prototype.codepointat": "^0.2.1", "tiny-inflate": "^1.0.2" diff --git a/package.json b/package.json index cc1774d..a1f00c9 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,6 @@ "uglify-es": "3.2.2" }, "dependencies": { - "opentype.js": "0.12.0" + "opentype.js": "^1.1.0" } } diff --git a/scripts/svg/VirtualTextSizer.mjs b/scripts/svg/VirtualTextSizer.mjs index 02f9c22..aa90e84 100644 --- a/scripts/svg/VirtualTextSizer.mjs +++ b/scripts/svg/VirtualTextSizer.mjs @@ -41,7 +41,14 @@ addFont('handlee', { const DEFAULT_FONT = 'sans-serif'; -const OPENTYPE_OPTIONS = {hinting: true}; +const OPENTYPE_OPTIONS = { + features: [ + {script: 'arab', tags: ['init', 'medi', 'fina', 'rlig']}, + {script: 'latn', tags: ['liga', 'rlig']}, + ], + hinting: true, + kerning: true, +}; function getFont(attrs) { const family = (attrs['font-family'] || DEFAULT_FONT).split(',');