Change fonts from having ascent=descent to having midpoint at .25em, and adjust font handling to do offsets from that.
This commit is contained in:
parent
26ebc33c37
commit
ead271e0e6
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -33,7 +33,7 @@
|
|||
|
||||
var EVENT, TOUCH, HOVER; // filled in later
|
||||
|
||||
var AXISHEIGHT = .25,
|
||||
var CENTERLINE = .25,
|
||||
STRUTHEIGHT = 1,
|
||||
AFUZZ = .08, HFUZZ = .025, DFUZZ = .025; // adjustments to bounding box of character boxes
|
||||
|
||||
|
@ -62,7 +62,7 @@
|
|||
},
|
||||
|
||||
"mjx-math": {
|
||||
"display": "inline-block",
|
||||
"display": "inline-block",
|
||||
"border-collapse":"collapse"
|
||||
},
|
||||
"mjx-math *": {display:"inline-block", "text-align":"left"},
|
||||
|
@ -823,7 +823,7 @@
|
|||
},
|
||||
|
||||
//
|
||||
// Get the height, depth and width of a character
|
||||
// Get the height, depth, and width of a character
|
||||
// (height and depth are of the font, not the character).
|
||||
// WARNING: causes reflow of the page!
|
||||
//
|
||||
|
@ -939,9 +939,10 @@
|
|||
}
|
||||
if (list.length) this.addCharList(node.firstChild,list,bbox);
|
||||
bbox.clean();
|
||||
if (bbox.d < 0) {bbox.D = bbox.d; bbox.d = 0}
|
||||
if (bbox.h || bbox.a) node.firstChild.style[bbox.h < 0 ? "marginTop" : "paddingTop"] = this.Em(bbox.h-(bbox.a||0));
|
||||
if (bbox.d) node.firstChild.style[bbox.d < 0 ? "marginBottom": "paddingBottom"] = this.Em(bbox.d);
|
||||
if (bbox.a == null) bbox.a = CENTERLINE;
|
||||
if (bbox.d + bbox.a < 0) {bbox.D = bbox.d; bbox.d = -bbox.a}
|
||||
if (bbox.h - bbox.a) node.firstChild.style[bbox.h - bbox.a < 0 ? "marginTop" : "paddingTop"] = this.Em(bbox.h-bbox.a);
|
||||
if (bbox.d + bbox.a) node.firstChild.style[bbox.d + bbox.a < 0 ? "marginBottom": "paddingBottom"] = this.Em(bbox.d+bbox.a);
|
||||
return bbox;
|
||||
},
|
||||
|
||||
|
@ -996,7 +997,7 @@
|
|||
var s = 1.1*(H - h)/k + .3; // space to cover by extender
|
||||
s /= (ebox.h+ebox.d); // scale factor;
|
||||
this.Transform(ext,
|
||||
"translateY("+CHTML.Em(-ebox.d+.25)+") scaleY("+s.toFixed(3).replace(/0+$/,"")+")",
|
||||
"translateY("+CHTML.Em(-ebox.d+.25-s*CENTERLINE)+") scaleY("+s.toFixed(3).replace(/0+$/,"")+")",
|
||||
"left "+CHTML.Em(ebox.d)
|
||||
);
|
||||
ext.style.paddingTop=ext.style.paddingBottom = 0;
|
||||
|
@ -1073,8 +1074,9 @@
|
|||
this.adjustHeights([left,ext,mid,ext2,right],hbox);
|
||||
if (ebox.D) ebox.d = ebox.D;
|
||||
hbox.t = hbox.h; hbox.b = hbox.d;
|
||||
if (hbox.h !== ebox.h) node.style.marginTop = CHTML.Em(ebox.h - hbox.h);
|
||||
if (hbox.d !== ebox.d) node.style.marginBottom = CHTML.Em(ebox.d - hbox.d);
|
||||
var mt = ebox.h - hbox.h - CENTERLINE, mb = ebox.d - hbox.d + CENTERLINE;
|
||||
if (mt) node.style.marginTop = CHTML.Em(mt);
|
||||
if (mb) node.style.marginBottom = CHTML.Em(mb);
|
||||
hbox.h = ebox.h; hbox.d = ebox.d;
|
||||
if (BBOX) {hbox.scale = BBOX.scale; hbox.rscale = BBOX.rscale}
|
||||
return hbox;
|
||||
|
@ -2061,7 +2063,7 @@
|
|||
stack.appendChild(over); stack.appendChild(base);
|
||||
}
|
||||
if (obox.D) obox.d = obox.D;
|
||||
if (obox.d < 0) {
|
||||
if (obox.d + CENTERLINE < 0) {
|
||||
//
|
||||
// For negative depths, set the height and align to top
|
||||
// in order to avoid extra baseline space
|
||||
|
@ -2112,7 +2114,7 @@
|
|||
node.firstChild.lastChild.appendChild(under);
|
||||
}
|
||||
if (ubox.D) ubox.d = ubox.D;
|
||||
if (ubox.d < 0) {
|
||||
if (ubox.d + CENTERLINE < 0) {
|
||||
//
|
||||
// For negative depths, set the height and align to top
|
||||
// in order to avoid extra baseline space
|
||||
|
|
Loading…
Reference in New Issue
Block a user