Skip to content

Commit 3973b4d

Browse files
committed
Add MathJax_Vector font with non-combining vector to avoid problems with combining characters in recent WebKit versions. Resolves issue #1709.
1 parent afb499f commit 3973b4d

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.

unpacked/jax/output/CommonHTML/fonts/TeX/fontdata.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@
9595
remap: {0x391:0x41, 0x392:0x42, 0x395:0x45, 0x396:0x5A, 0x397:0x48,
9696
0x399:0x49, 0x39A:0x4B, 0x39C:0x4D, 0x39D:0x4E, 0x39F:0x4F,
9797
0x3A1:0x50, 0x3A4:0x54, 0x3A7:0x58,
98+
0xEEE2: [0xEEE2, "-TeX-vec"], // HACK: for \vec (see #1709)
99+
0xE160: [0x2192, "-TeX-vec"], // HACK: for \vec (see #1709)
98100
0x2016:0x2225,
99101
0x2216:[0x2216,"-TeX-variant"], // \smallsetminus
100102
0x210F:[0x210F,"-TeX-variant"], // \hbar
@@ -154,6 +156,7 @@
154156
0x2216:[0x2216,MML.VARIANT.NORMAL], // \setminus
155157
0x210F:[0x210F,MML.VARIANT.NORMAL] // \hslash
156158
}},
159+
"-TeX-vec": {fonts: ["MathJax_Vector"], cache:{}}, // HACK: non-combining \vec
157160
"-largeOp": {fonts:[SIZE2,SIZE1,MAIN,AMS],cache:{}},
158161
"-smallOp": {fonts:[SIZE1,MAIN,AMS], cache:{}},
159162
"-tex-caligraphic-bold": {fonts:["MathJax_Caligraphic-Bold","MathJax_Main-Bold"], bold:true, cache:{}, chain:"normal",
@@ -229,6 +232,8 @@
229232
0x231C: 0x250C, 0x231D:0x2510, // wrong placement of \ulcorner, \urcorner
230233
0x231E: 0x2514, 0x231F:0x2518, // wrong placement of \llcorner, \lrcorner
231234

235+
0x20D7: "\uEEE2\uE160", // HACK: for non-combining \vec (#1709)
236+
232237
//
233238
// compound symbols not in these fonts
234239
//
@@ -1590,6 +1595,12 @@
15901595
0xE153: [333,0,450,-10,474], // stix-horizontal brace, upper right piece
15911596
0xE154: [120,0,400,-10,410] // stix-oblique open face capital letter A
15921597
};
1598+
1599+
CHTML.FONTDATA.FONTS['MathJax_Vector'] = {
1600+
centerline: 357, ascent: 714, descent: 0,
1601+
0x2192: [714,-516,500.1,29,471], // vector arrow (w = 500.1 to avoid zero width)
1602+
0xEEE2: [0,0,-500,0,0,{space:1}] // backspace
1603+
};
15931604

15941605
CHTML.FONTDATA.FONTS[MAIN][0x2212][0] = CHTML.FONTDATA.FONTS[MAIN][0x002B][0]; // minus is sized as plus
15951606
CHTML.FONTDATA.FONTS[MAIN][0x2212][1] = CHTML.FONTDATA.FONTS[MAIN][0x002B][1]; // minus is sized as plus
@@ -1641,7 +1652,7 @@
16411652
CHTML.FONTDATA.familyName = function (font) {
16421653
font = font.replace(/^MathJax_/,"");
16431654
var names = (font+"-Regular").split(/-/);
1644-
var suffix = names[0].toLowerCase().replace(/(?:igraphic|serif|writer|tur)$/,"")
1655+
var suffix = names[0].toLowerCase().replace(/(?:igraphic|serif|writer|tur|tor)$/,"")
16451656
+ "-" + names[1].replace(/[^A-Z]/g,"");
16461657
return "MJXc-TeX-"+suffix;
16471658
};

0 commit comments

Comments
 (0)