Alter fonts to make ascent=descent so that line-height:0 makes its axis along the baseline. That should simplify things (though it may make unknown characters harder to handle -- we'll see).
This commit is contained in:
parent
434606ae1f
commit
9ed49e85e4
|
@ -586,8 +586,6 @@
|
||||||
|
|
||||||
CHTML.FONTDATA.FONTS['MathJax_Caligraphic'] = {
|
CHTML.FONTDATA.FONTS['MathJax_Caligraphic'] = {
|
||||||
directory: 'Caligraphic/Regular',
|
directory: 'Caligraphic/Regular',
|
||||||
ascent: .789,
|
|
||||||
descent: .216,
|
|
||||||
skew: {
|
skew: {
|
||||||
0x41: 0.194,
|
0x41: 0.194,
|
||||||
0x42: 0.139,
|
0x42: 0.139,
|
||||||
|
@ -659,8 +657,6 @@
|
||||||
CHTML.FONTDATA.FONTS['MathJax_Main-bold'] = {
|
CHTML.FONTDATA.FONTS['MathJax_Main-bold'] = {
|
||||||
directory: 'Main/Bold',
|
directory: 'Main/Bold',
|
||||||
weight: 'bold',
|
weight: 'bold',
|
||||||
ascent: .951,
|
|
||||||
descent: .267,
|
|
||||||
skew: {
|
skew: {
|
||||||
0x131: 0.0319,
|
0x131: 0.0319,
|
||||||
0x237: 0.0958,
|
0x237: 0.0958,
|
||||||
|
@ -797,8 +793,6 @@
|
||||||
CHTML.FONTDATA.FONTS['MathJax_Main-italic'] = {
|
CHTML.FONTDATA.FONTS['MathJax_Main-italic'] = {
|
||||||
directory: 'Main/Italic',
|
directory: 'Main/Italic',
|
||||||
style: 'italic',
|
style: 'italic',
|
||||||
ascent: .750,
|
|
||||||
descent: .250,
|
|
||||||
Ranges: [
|
Ranges: [
|
||||||
[0xA0,0xFF,"Latin1Supplement"],
|
[0xA0,0xFF,"Latin1Supplement"],
|
||||||
[0x300,0x36F,"CombDiacritMarks"],
|
[0x300,0x36F,"CombDiacritMarks"],
|
||||||
|
@ -910,8 +904,6 @@
|
||||||
|
|
||||||
CHTML.FONTDATA.FONTS['MathJax_Main'] = {
|
CHTML.FONTDATA.FONTS['MathJax_Main'] = {
|
||||||
directory: 'Main/Regular',
|
directory: 'Main/Regular',
|
||||||
ascent: .900,
|
|
||||||
descent: .272,
|
|
||||||
skew: {
|
skew: {
|
||||||
0x131: 0.0278,
|
0x131: 0.0278,
|
||||||
0x237: 0.0833,
|
0x237: 0.0833,
|
||||||
|
@ -1192,8 +1184,6 @@
|
||||||
CHTML.FONTDATA.FONTS['MathJax_Math-italic'] = {
|
CHTML.FONTDATA.FONTS['MathJax_Math-italic'] = {
|
||||||
directory: 'Math/Italic',
|
directory: 'Math/Italic',
|
||||||
style: 'italic',
|
style: 'italic',
|
||||||
ascent: .717,
|
|
||||||
descent: .218,
|
|
||||||
skew: {
|
skew: {
|
||||||
0x41: 0.139,
|
0x41: 0.139,
|
||||||
0x42: 0.0833,
|
0x42: 0.0833,
|
||||||
|
@ -1372,8 +1362,6 @@
|
||||||
|
|
||||||
CHTML.FONTDATA.FONTS['MathJax_Size1'] = {
|
CHTML.FONTDATA.FONTS['MathJax_Size1'] = {
|
||||||
directory: 'Size1/Regular',
|
directory: 'Size1/Regular',
|
||||||
ascent: .850,
|
|
||||||
descent: .350,
|
|
||||||
0x20: [0,0,250,0,0], // SPACE
|
0x20: [0,0,250,0,0], // SPACE
|
||||||
0x28: [850,349,458,152,422], // LEFT PARENTHESIS
|
0x28: [850,349,458,152,422], // LEFT PARENTHESIS
|
||||||
0x29: [850,349,458,35,305], // RIGHT PARENTHESIS
|
0x29: [850,349,458,35,305], // RIGHT PARENTHESIS
|
||||||
|
@ -1423,8 +1411,6 @@
|
||||||
|
|
||||||
CHTML.FONTDATA.FONTS['MathJax_Size2'] = {
|
CHTML.FONTDATA.FONTS['MathJax_Size2'] = {
|
||||||
directory: 'Size2/Regular',
|
directory: 'Size2/Regular',
|
||||||
ascent: 1.360,
|
|
||||||
descent: .862,
|
|
||||||
0x20: [0,0,250,0,0], // SPACE
|
0x20: [0,0,250,0,0], // SPACE
|
||||||
0x28: [1150,649,597,180,561], // LEFT PARENTHESIS
|
0x28: [1150,649,597,180,561], // LEFT PARENTHESIS
|
||||||
0x29: [1150,649,597,35,416], // RIGHT PARENTHESIS
|
0x29: [1150,649,597,35,416], // RIGHT PARENTHESIS
|
||||||
|
@ -1466,8 +1452,6 @@
|
||||||
|
|
||||||
CHTML.FONTDATA.FONTS['MathJax_Size3'] = {
|
CHTML.FONTDATA.FONTS['MathJax_Size3'] = {
|
||||||
directory: 'Size3/Regular',
|
directory: 'Size3/Regular',
|
||||||
ascent: 1.450,
|
|
||||||
descent: .950,
|
|
||||||
0x20: [0,0,250,0,0], // SPACE
|
0x20: [0,0,250,0,0], // SPACE
|
||||||
0x28: [1450,949,736,209,701], // LEFT PARENTHESIS
|
0x28: [1450,949,736,209,701], // LEFT PARENTHESIS
|
||||||
0x29: [1450,949,736,34,526], // RIGHT PARENTHESIS
|
0x29: [1450,949,736,34,526], // RIGHT PARENTHESIS
|
||||||
|
@ -1493,8 +1477,6 @@
|
||||||
|
|
||||||
CHTML.FONTDATA.FONTS['MathJax_Size4'] = {
|
CHTML.FONTDATA.FONTS['MathJax_Size4'] = {
|
||||||
directory: 'Size4/Regular',
|
directory: 'Size4/Regular',
|
||||||
ascent: 1.750,
|
|
||||||
descent: 1.250,
|
|
||||||
0x20: [0,0,250,0,0], // SPACE
|
0x20: [0,0,250,0,0], // SPACE
|
||||||
0x28: [1750,1249,792,237,758], // LEFT PARENTHESIS
|
0x28: [1750,1249,792,237,758], // LEFT PARENTHESIS
|
||||||
0x29: [1750,1249,792,33,554], // RIGHT PARENTHESIS
|
0x29: [1750,1249,792,33,554], // RIGHT PARENTHESIS
|
||||||
|
|
|
@ -34,8 +34,7 @@
|
||||||
var EVENT, TOUCH, HOVER; // filled in later
|
var EVENT, TOUCH, HOVER; // filled in later
|
||||||
|
|
||||||
var SCRIPTFACTOR = Math.sqrt(1/2),
|
var SCRIPTFACTOR = Math.sqrt(1/2),
|
||||||
AXISHEIGHT = .25,
|
AXISHEIGHT = .25;
|
||||||
HFUZZ = .05, DFUZZ = 0; // adjustments to bounding box of character boxes
|
|
||||||
|
|
||||||
var STYLES = {
|
var STYLES = {
|
||||||
".MathJax_CHTML_Display": {
|
".MathJax_CHTML_Display": {
|
||||||
|
@ -558,14 +557,8 @@
|
||||||
}
|
}
|
||||||
this.addCharList(node.firstChild,list,bbox);
|
this.addCharList(node.firstChild,list,bbox);
|
||||||
this.cleanBBox(bbox);
|
this.cleanBBox(bbox);
|
||||||
bbox.h += HFUZZ; bbox.d += DFUZZ;
|
node.firstChild.style.paddingTop = this.Em(bbox.h);
|
||||||
bbox.t += HFUZZ; bbox.b += DFUZZ;
|
node.firstChild.style.paddingBottom = this.Em(bbox.d);
|
||||||
var a = (bbox.H-bbox.D)/2; // center of font (line-height:0)
|
|
||||||
if (a < bbox.h) {node.firstChild.style.paddingTop = this.Em(bbox.h-a)}
|
|
||||||
else {node.firstChild.style.marginTop = this.Em(bbox.h-a)}
|
|
||||||
// ### FIXME: Safari doesn't center, so clip bbox.d at 0 and adjust later?
|
|
||||||
if (bbox.d+1 > 0) {node.firstChild.style.paddingBottom = this.Em(bbox.d+a)}
|
|
||||||
else {node.firstChild.style.marginBottom = this.Em(bbox.d+a)}
|
|
||||||
return bbox;
|
return bbox;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user