Support some Unicode Mathematical Alphanumeric Symbols (#1232)

* Support some  Unicode Mathematical Alphanumeric Symbols

This PR adds support for some of the characters in Unicode range U+1D400 to U+1D7FF, [Mathematical Alphanumeric Symbols](https://www.unicode.org/charts/PDF/U1D400.pdf).  Specifically, it adds support for:
* A-Z a-z bold
* A-Z a-z bold italic
* A-Z a-z Fractur
* A-Z a-z sans-serif
* A-Z double struck
•	A-Z script

Addresses issue #1215 and parts of #260.

* Fix lint error

* Fix MathML, and pick up review comments

* Fix lint error

* Add text mode. Remove sans-serif.

* Fix lint error

* Fixed \mathrm, added screenshotter test

* Change screenshotter test to an array

* Add screenshots

* Picked up review comments. Add characters
This commit is contained in:
Ron Kok
2018-05-07 17:06:16 -07:00
committed by Kevin Barabash
parent f25e08d618
commit f01f504cfe
9 changed files with 250 additions and 9 deletions

View File

@@ -3006,7 +3006,7 @@ describe("Unicode", function() {
expect("±×÷∓∔∧∨∩∪≀⊎⊓⊔⊕⊖⊗⊘⊙⊚⊛⊝⊞⊟⊠⊡⊺⊻⊼⋇⋉⋊⋋⋌⋎⋏⋒⋓⩞\u22C5").toParse();
});
it("should parse delimeters", function() {
it("should build delimiters", function() {
expect("\\left\u230A\\frac{a}{b}\\right\u230B").toBuild();
expect("\\left\u2308\\frac{a}{b}\\right\u2308").toBuild();
expect("\\left\u27ee\\frac{a}{b}\\right\u27ef").toBuild();
@@ -3014,6 +3014,41 @@ describe("Unicode", function() {
expect("\\left\u23b0\\frac{a}{b}\\right\u23b1").toBuild();
expect("┌x┐ └x┘").toBuild();
});
it("should build some surrogate pairs", function() {
let wideCharStr = "";
wideCharStr += String.fromCharCode(0xD835, 0xDC00); // bold A
wideCharStr += String.fromCharCode(0xD835, 0xDC68); // bold italic A
wideCharStr += String.fromCharCode(0xD835, 0xDD04); // Fraktur A
wideCharStr += String.fromCharCode(0xD835, 0xDD38); // double-struck
wideCharStr += String.fromCharCode(0xD835, 0xDC9C); // script A
wideCharStr += String.fromCharCode(0xD835, 0xDDA0); // sans serif A
wideCharStr += String.fromCharCode(0xD835, 0xDDD4); // bold sans A
wideCharStr += String.fromCharCode(0xD835, 0xDE08); // italic sans A
wideCharStr += String.fromCharCode(0xD835, 0xDE70); // monospace A
wideCharStr += String.fromCharCode(0xD835, 0xDFCE); // bold zero
wideCharStr += String.fromCharCode(0xD835, 0xDFE2); // sans serif zero
wideCharStr += String.fromCharCode(0xD835, 0xDFEC); // bold sans zero
wideCharStr += String.fromCharCode(0xD835, 0xDFF6); // monospace zero
expect(wideCharStr).toBuild();
let wideCharText = "\text{";
wideCharText += String.fromCharCode(0xD835, 0xDC00); // bold A
wideCharText += String.fromCharCode(0xD835, 0xDC68); // bold italic A
wideCharText += String.fromCharCode(0xD835, 0xDD04); // Fraktur A
wideCharText += String.fromCharCode(0xD835, 0xDD38); // double-struck
wideCharText += String.fromCharCode(0xD835, 0xDC9C); // script A
wideCharText += String.fromCharCode(0xD835, 0xDDA0); // sans serif A
wideCharText += String.fromCharCode(0xD835, 0xDDD4); // bold sans A
wideCharText += String.fromCharCode(0xD835, 0xDE08); // italic sans A
wideCharText += String.fromCharCode(0xD835, 0xDE70); // monospace A
wideCharText += String.fromCharCode(0xD835, 0xDFCE); // bold zero
wideCharText += String.fromCharCode(0xD835, 0xDFE2); // sans serif zero
wideCharText += String.fromCharCode(0xD835, 0xDFEC); // bold sans zero
wideCharText += String.fromCharCode(0xD835, 0xDFF6); // monospace zero
wideCharText += "}";
expect(wideCharText).toBuild();
});
});
describe("The maxSize setting", function() {