From 6478163a397bf784b141cb397d42bf5ecce26c56 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 17 Mar 2015 07:09:06 -0400 Subject: [PATCH] Make mn handle italic correction and skew like mn does. --- unpacked/jax/output/CommonHTML/jax.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js index f68af6f87..21bf52d14 100644 --- a/unpacked/jax/output/CommonHTML/jax.js +++ b/unpacked/jax/output/CommonHTML/jax.js @@ -1356,7 +1356,22 @@ node = this.CHTMLdefaultNode(node); var bbox = this.CHTML, text = this.data.join(""); if (bbox.skew != null && text.length !== 1) delete bbox.skew; - if (bbox.r > bbox.w && text.length === 1 /*&& !variant.noIC*/) { // ### FIXME: handle variants + if (bbox.r > bbox.w && text.length === 1 && !this.CHTMLvariant.noIC) { + bbox.ic = bbox.r - bbox.w; bbox.w = bbox.r; + node.lastChild.style.paddingRight = CHTML.Em(bbox.ic); + } + return node; + } + }); + + /********************************************************/ + + MML.mn.Augment({ + toCommonHTML: function (node) { + node = this.CHTMLdefaultNode(node); + var bbox = this.CHTML, text = this.data.join(""); + if (bbox.skew != null && text.length !== 1) delete bbox.skew; + if (bbox.r > bbox.w && text.length === 1 && !this.CHTMLvariant.noIC) { bbox.ic = bbox.r - bbox.w; bbox.w = bbox.r; node.lastChild.style.paddingRight = CHTML.Em(bbox.ic); }