Use proper bar character for STIX stretchy arrows from bar, and properly handle zero-width characters in createChar()

This commit is contained in:
Davide P. Cervone 2011-09-18 21:05:25 -04:00
parent 88c650dd16
commit d37ba91b6b
8 changed files with 15 additions and 17 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -62,7 +62,7 @@
0x21A6: // right arrow from bar 0x21A6: // right arrow from bar
{ {
dir: H, HW: [[1,GENERAL]], dir: H, HW: [[1,GENERAL]],
stretch: {left:[0x22A2,BOLD,0,0.1,.6], rep:[0x2212,GENERAL], right:[0x2192,GENERAL]} stretch: {left:[0xE0B6,NONUNI], rep:[0x2212,GENERAL], right:[0x2192,GENERAL]}
}, },
0x21A7: // down arrow from bar 0x21A7: // down arrow from bar
{ {
@ -185,7 +185,7 @@
0x295B: // rightwards harpoon with barb up from bar 0x295B: // rightwards harpoon with barb up from bar
{ {
dir: H, HW: [[.926,GENERAL]], dir: H, HW: [[.926,GENERAL]],
stretch: {left:[0x22A2,BOLD,0,0.1,.6], rep:[0x2212,GENERAL], right:[0x21C0,GENERAL]} stretch: {left:[0xE0B6,NONUNI], rep:[0x2212,GENERAL], right:[0x21C0,GENERAL]}
}, },
0x295C: // up harpoon with barb right from bar 0x295C: // up harpoon with barb right from bar
{ {
@ -205,7 +205,7 @@
0x295F: // rightwards harpoon with barb down from bar 0x295F: // rightwards harpoon with barb down from bar
{ {
dir: H, HW: [[.926,GENERAL]], dir: H, HW: [[.926,GENERAL]],
stretch: {left:[0x22A2,BOLD,0,0.1,.6], rep:[0x2212,GENERAL], right:[0x21C1,GENERAL]} stretch: {left:[0xE0B6,NONUNI], rep:[0x2212,GENERAL], right:[0x21C1,GENERAL]}
}, },
0x2960: // up harpoon with barb left from bar 0x2960: // up harpoon with barb left from bar
{ {

View File

@ -871,13 +871,14 @@
var H = this.Em(Math.max(0,h+d)), D = this.Em(-d); var H = this.Em(Math.max(0,h+d)), D = this.Em(-d);
if (this.msieInlineBlockAlignBug) {D = this.Em(HTMLCSS.getHD(span.parentNode).d-d)} if (this.msieInlineBlockAlignBug) {D = this.Em(HTMLCSS.getHD(span.parentNode).d-d)}
if (span.isBox || span.className == "mspace") { if (span.isBox || span.className == "mspace") {
var scale = (span.scale == null ? 1 : span.scale);
span.bbox = { span.bbox = {
exactW: true, exactW: true,
h: h*span.scale, d: d*span.scale, h: h*scale, d: d*scale,
w: w*span.scale, rw: w*span.scale, lw: 0 w: w*scale, rw: w*scale, lw: 0
}; };
span.style.height = H; span.style.verticalAlign = D; span.style.height = H; span.style.verticalAlign = D;
span.HH = (h+d)*span.scale; span.HH = (h+d)*scale;
} else { } else {
span = this.addElement(span,"span",{style: {height:H, verticalAlign:D}, isMathJax:true}); span = this.addElement(span,"span",{style: {height:H, verticalAlign:D}, isMathJax:true});
} }
@ -1177,11 +1178,8 @@
} }
if (data[5]) {span.bbox.h += data[5]} // extra height if (data[5]) {span.bbox.h += data[5]} // extra height
if (data[6]) {span.bbox.d += data[6]} // extra depth if (data[6]) {span.bbox.d += data[6]} // extra depth
if (this.AccentBug && span.bbox.w === 0) { // Handle combining characters by adding a non-breaking space so it shows up
// Handle combining characters by adding a non-breaking space and removing that width if (this.AccentBug && span.bbox.w === 0) {SPAN.firstChild.nodeValue += this.NBSP}
SPAN.firstChild.nodeValue += this.NBSP;
HTMLCSS.createSpace(span,0,0,-span.offsetWidth/HTMLCSS.em);
}
}, },
positionDelimiter: function (span,h) { positionDelimiter: function (span,h) {
h -= span.bbox.h; span.bbox.d -= h; span.bbox.h += h; h -= span.bbox.h; span.bbox.d -= h; span.bbox.h += h;