diff --git a/unpacked/jax/output/CommonHTML/fonts/TeX/fontdata.js b/unpacked/jax/output/CommonHTML/fonts/TeX/fontdata.js index 59261b9c9..ef09a3505 100644 --- a/unpacked/jax/output/CommonHTML/fonts/TeX/fontdata.js +++ b/unpacked/jax/output/CommonHTML/fonts/TeX/fontdata.js @@ -1548,6 +1548,17 @@ // Add some spacing characters // MathJax.Hub.Insert(CHTML.FONTDATA.FONTS[MAIN],{ + 0x2000: [0,0,500,0,0,{space:1}], // en space + 0x2001: [0,0,1000,0,0,{space:1}], // em quad + 0x2002: [0,0,500,0,0,{space:1}], // en quad + 0x2003: [0,0,1000,0,0,{space:1}], // em space + 0x2004: [0,0,333,0,0,{space:1}], // 3-per-em space + 0x2005: [0,0,250,0,0,{space:1}], // 4-per-em space + 0x2006: [0,0,167,0,0,{space:1}], // 6-per-em space + 0x2009: [0,0,167,0,0,{space:1}], // thin space + 0x200A: [0,0,100,0,0,{space:1}], // hair space + 0x200B: [0,0,0,0,0,{space:1}], // zero-width space + 0x200C: [0,0,0,0,0,{space:1}], // zero-width non-joiner space 0x2061: [0,0,0,0,0,{space:1}], // function application 0x2062: [0,0,0,0,0,{space:1}], // invisible times 0x2063: [0,0,0,0,0,{space:1}], // invisible separator diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js index c3a8bf6a7..2fdde0115 100644 --- a/unpacked/jax/output/CommonHTML/jax.js +++ b/unpacked/jax/output/CommonHTML/jax.js @@ -35,7 +35,7 @@ var SCRIPTFACTOR = Math.sqrt(1/2), AXISHEIGHT = .25, - HFUZZ = .05, DFUZZ = 0; // adjustments to bounding box of character boxes + HFUZZ = .025, DFUZZ = .025; // adjustments to bounding box of character boxes var STYLES = { ".MathJax_CHTML_Display": { @@ -494,7 +494,7 @@ // if (typeof(font) === "string") this.loadFont(font); var C = font[n]; if (C) { -// ### FIXME: implement aliases, spaces, etc. +// ### FIXME: implement aliases if (C.length === 5) C[5] = {}; if (C.c == null) { C[0] /= 1000; C[1] /= 1000; C[2] /= 1000; C[3] /= 1000; C[4] /= 1000; @@ -506,6 +506,7 @@ + String.fromCharCode((N&0x3FF)+0xDC00); } } + if (C[5].space) return {type:"space", w:C[2]}; return {type:"char", font:font, n:n}; } // else load block files? } @@ -536,6 +537,14 @@ if (bbox.r < bbox.w+C[4]) bbox.r = bbox.w+C[4]; bbox.w += C[2]; if (m == 1 && font.skew && font.skew[item.n]) bbox.skew = font.skew[item.n]; + break; + + case "space": + if (item.w) { + HTML.addElement(node,"mjx-space",{style:{"margin-left":CHTML.Em(item.w)}}); + bbox.w += item.w; + } + break; } } if (node.childNodes.length) {