Skip to content

Commit bf5a94b

Browse files
authored
Merge pull request #1954 from dpvc/patch-spaces
Make monospaced non-breaking space be of correct width. #1953
2 parents 9d71f3c + c4b19f6 commit bf5a94b

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,8 @@
16401640
MathJax.Hub.Register.LoadHook(CHTML.fontDir+"/TeX/Typewriter-Regular.js",function () {
16411641
CHTML.FONTDATA.FONTS['MathJax_Typewriter'][0x20][2] += 275; // fix error in character width
16421642
CHTML.FONTDATA.FONTS['MathJax_Typewriter'][0x20][5] = {rfix:275}; // fix error in character width
1643+
CHTML.FONTDATA.FONTS['MathJax_Typewriter'][0xA0][2] += 275; // fix error in character width
1644+
CHTML.FONTDATA.FONTS['MathJax_Typewriter'][0xA0][5] = {rfix:275}; // fix error in character width
16431645
});
16441646

16451647
//

unpacked/jax/output/HTML-CSS/fonts/STIX/fontdata.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"sans-serif-italic": {fonts: [ITALIC,NONUNII], offsetA: 0x1D608, offsetN: 0xE1B4, offsetG: 0xE1BF, offsetE: 0xE1BF, italic:true},
9595
"sans-serif-bold-italic": {fonts: [BITALIC,"STIXNonUnicode-bold-italic"], offsetA: 0x1D63C, offsetN: 0xE1F6, offsetG: 0x1D790, bold:true, italic:true},
9696
"monospace": {offsetA: 0x1D670, offsetN: 0x1D7F6,
97-
remap: {0x20: [0x20,"-STIX-variant"]}}, // use a special space for monospace (see below)
97+
remap: {0x20: [0x20,"-STIX-variant"], 0xA0: [0xA0,"-STIX-variant"]}}, // use a special space for monospace (see below)
9898
"-STIX-variant": {fonts:["STIXVariants",NONUNI,GENERAL],
9999
remap: {0x2A87: 0xE010, 0x2A88: 0xE00F, 0x2270: 0xE011, 0x2271: 0xE00E,
100100
0x22E0: 0xE04B, 0x22E1: 0xE04F, 0x2288: 0xE016, 0x2289: 0xE018,
@@ -1526,6 +1526,8 @@
15261526
// monospace mathvariant uses space from STIXVariants, so make it the right size
15271527
HTMLCSS.FONTDATA.FONTS['STIXVariants'][0x20][2] += 275; // fix error in character width
15281528
HTMLCSS.FONTDATA.FONTS['STIXVariants'][0x20][5] = {rfix:275}; // fix error in character width
1529+
HTMLCSS.FONTDATA.FONTS['STIXVariants'][0xA0][2] += 275; // fix error in character width
1530+
HTMLCSS.FONTDATA.FONTS['STIXVariants'][0xA0][5] = {rfix:275}; // fix error in character width
15291531
});
15301532

15311533
//

unpacked/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,6 +1588,10 @@
15881588
HTMLCSS.FONTDATA.FONTS['MathJax_Typewriter'][0x20][2] += 275; // fix error in character width
15891589
HTMLCSS.FONTDATA.FONTS['MathJax_Typewriter'][0x20][5] = {rfix:275}; // fix error in character width
15901590
});
1591+
MathJax.Hub.Register.LoadHook(HTMLCSS.fontDir+"/Typewriter/Regular/Other.js",function () {
1592+
HTMLCSS.FONTDATA.FONTS['MathJax_Typewriter'][0xA0][2] += 275; // fix error in character width
1593+
HTMLCSS.FONTDATA.FONTS['MathJax_Typewriter'][0xA0][5] = {rfix:275}; // fix error in character width
1594+
});
15911595

15921596
//
15931597
// Add some spacing characters (more will come later)

0 commit comments

Comments
 (0)