Skip to content

Commit 3310136

Browse files
authored
Merge pull request #1595 from dpvc/issue1594
Properly scale elements with font-family specified. #1594
2 parents 37c3bcf + aba0f46 commit 3310136

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

unpacked/jax/output/CommonHTML/autoload/mmultiscripts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
3535
if (!stretch) {
3636
node = this.CHTMLcreateNode(node);
3737
this.CHTMLhandleStyle(node);
38-
this.CHTMLhandleScale(node);
3938
this.CHTMLgetVariant();
39+
this.CHTMLhandleScale(node);
4040
}
4141
CHTML.BBOX.empty(this.CHTML);
4242

unpacked/jax/output/CommonHTML/autoload/ms.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ MathJax.Hub.Register.StartupHook("CommonHTML Jax Ready",function () {
3737
//
3838
node = this.CHTMLcreateNode(node);
3939
this.CHTMLhandleStyle(node);
40-
this.CHTMLhandleScale(node);
4140
this.CHTMLgetVariant();
41+
this.CHTMLhandleScale(node);
4242
CHTML.BBOX.empty(this.CHTML);
4343
//
4444
// Get the quotes to use

unpacked/jax/output/CommonHTML/jax.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,8 +1388,8 @@
13881388
if (!options) options = {};
13891389
node = this.CHTMLcreateNode(node); this.CHTML = CHTML.BBOX.empty();
13901390
this.CHTMLhandleStyle(node);
1391-
this.CHTMLhandleScale(node);
13921391
if (this.isToken) this.CHTMLgetVariant();
1392+
this.CHTMLhandleScale(node);
13931393
var m = Math.max((options.minChildren||0),this.data.length);
13941394
for (var i = 0; i < m; i++) this.CHTMLaddChild(node,i,options);
13951395
if (!options.noBBox) this.CHTML.clean();
@@ -1545,6 +1545,9 @@
15451545
values.fontsize = this.removedStyles.fontSize;
15461546
if (values.fontsize && !this.mathsize) values.mathsize = values.fontsize;
15471547
if (values.mathsize !== 1) scale *= CHTML.length2em(values.mathsize,1,1);
1548+
var variant = this.CHTMLvariant;
1549+
if (variant && variant.style && variant.style["font-family"])
1550+
scale *= (CHTML.config.scale/100)/CHTML.scale;
15481551
this.CHTML.scale = scale; pscale = this.CHTML.rscale = scale/pscale;
15491552
if (Math.abs(pscale-1) < .001) pscale = 1;
15501553
if (node && pscale !== 1) node.style.fontSize = CHTML.Percent(pscale);
@@ -1820,8 +1823,8 @@
18201823
toCommonHTML: function (node) {
18211824
node = this.CHTMLcreateNode(node);
18221825
this.CHTMLhandleStyle(node);
1823-
this.CHTMLhandleScale(node);
18241826
this.CHTMLgetVariant();
1827+
this.CHTMLhandleScale(node);
18251828
CHTML.BBOX.empty(this.CHTML);
18261829

18271830
var values = this.getValues("displaystyle","largeop");

0 commit comments

Comments
 (0)