mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
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:
@@ -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() {
|
||||
|
BIN
test/screenshotter/images/SurrogatePairs-chrome.png
Normal file
BIN
test/screenshotter/images/SurrogatePairs-chrome.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
BIN
test/screenshotter/images/SurrogatePairs-firefox.png
Normal file
BIN
test/screenshotter/images/SurrogatePairs-firefox.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
@@ -292,6 +292,12 @@ SupSubHorizSpacing: |
|
||||
SupSubLeftAlignReset: |
|
||||
\omega^8_{888} \quad \frac{1}{\hat{\omega}^{8}_{888}} \quad \displaystyle\sum_{\omega^{8}_{888}}
|
||||
SupSubOffsets: \displaystyle \int_{2+3}x f^{2+3}+3\lim_{2+3+4+5}f
|
||||
SurrogatePairs: |
|
||||
\begin{array}{l}
|
||||
𝐀𝐚𝑨𝒂𝔅𝔞𝔸𝒜 \\
|
||||
\text{𝐀𝐚𝑨𝒂𝔅𝔞𝔸𝒜} \\
|
||||
\mathrm{𝐀𝐚𝑨𝒂𝔅𝔞𝔸𝒜}
|
||||
\end{array}
|
||||
SvgReset:
|
||||
# This math uses a lot of SVG glyphs
|
||||
tex: '\underbrace{\sqrt{\vec{x}} + \sqrt{\vec{\color{#f00}y}}}'
|
||||
|
Reference in New Issue
Block a user