Skip to content

Commit fc47ec0

Browse files
committed
Properly scale elements with font-family specified. Resolves issue #1594.
1 parent 4a9bee1 commit fc47ec0

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

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

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

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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,8 +1386,8 @@
13861386
if (!options) options = {};
13871387
node = this.CHTMLcreateNode(node); this.CHTML = CHTML.BBOX.empty();
13881388
this.CHTMLhandleStyle(node);
1389-
this.CHTMLhandleScale(node);
13901389
if (this.isToken) this.CHTMLgetVariant();
1390+
this.CHTMLhandleScale(node);
13911391
var m = Math.max((options.minChildren||0),this.data.length);
13921392
for (var i = 0; i < m; i++) this.CHTMLaddChild(node,i,options);
13931393
if (!options.noBBox) this.CHTML.clean();
@@ -1543,6 +1543,8 @@
15431543
values.fontsize = this.removedStyles.fontSize;
15441544
if (values.fontsize && !this.mathsize) values.mathsize = values.fontsize;
15451545
if (values.mathsize !== 1) scale *= CHTML.length2em(values.mathsize,1,1);
1546+
var variant = this.CHTMLvariant;
1547+
if (variant && variant.style && variant.style["font-family"]) scale /= CHTML.scale;
15461548
this.CHTML.scale = scale; pscale = this.CHTML.rscale = scale/pscale;
15471549
if (Math.abs(pscale-1) < .001) pscale = 1;
15481550
if (node && pscale !== 1) node.style.fontSize = CHTML.Percent(pscale);
@@ -1817,8 +1819,8 @@
18171819
toCommonHTML: function (node) {
18181820
node = this.CHTMLcreateNode(node);
18191821
this.CHTMLhandleStyle(node);
1820-
this.CHTMLhandleScale(node);
18211822
this.CHTMLgetVariant();
1823+
this.CHTMLhandleScale(node);
18221824
CHTML.BBOX.empty(this.CHTML);
18231825

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

0 commit comments

Comments
 (0)