From 3b108856f86ed948a20a4a0ef971ed9824c9f43a Mon Sep 17 00:00:00 2001 From: Wenting Zhang Date: Thu, 10 Feb 2022 17:48:13 -0500 Subject: [PATCH] dynamic svg size for SamsaGlyph.prototype.svg() update SamsaGlyph.prototype.svg function so the exported SVG's width and height is set dynamically with font.unitsPerEm this helps with fonts with non-standard canvas size. --- src/samsa-core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/samsa-core.js b/src/samsa-core.js index 9d87f8d..94f0dba 100644 --- a/src/samsa-core.js +++ b/src/samsa-core.js @@ -1138,7 +1138,7 @@ SamsaGlyph.prototype.svg = function (style={}) { + (style.fill ? ` fill="${style.fill}"` : "") + (style.stroke ? ` stroke="${style.stroke}"` : "") + (style.strokeWidth ? ` stroke-width="${style.strokeWidth}"` : ""); - return ` + return `