diff --git a/lib/matplotlib/_mathtext.py b/lib/matplotlib/_mathtext.py index c41d2d4caa55..8319d9a692c3 100644 --- a/lib/matplotlib/_mathtext.py +++ b/lib/matplotlib/_mathtext.py @@ -31,7 +31,8 @@ import matplotlib as mpl from . import cbook from ._mathtext_data import ( - latex_to_bakoma, stix_glyph_fixes, stix_virtual_fonts, tex2uni) + latex_to_bakoma, stix_glyph_fixes, stix_virtual_fonts, tex2uni, + unicode_math_lut, greek_uppercase_domain, greek_lowercase_domain) from .font_manager import FontProperties, findfont, get_font from .ft2font import FT2Font, Kerning, LoadFlags @@ -740,6 +741,124 @@ class DejaVuSansFonts(DejaVuFonts): } +class UnicodeMathFonts(TruetypeFonts): + """ + A font handling class for Unicode mathematics fonts. + + In addition to what TruetypeFonts provides, this class: + + - supports mapping alphanumeric characters (latin and greek) to different alphabet + styles (such as bold, italic, fraktur, script, double-struck, ...) defined in + the Unicode standard. + + """ + + def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlags): + TruetypeFonts.__init__(self, default_font_prop, load_glyph_flags) + prop = mpl.rcParams['mathtext.mathfont'] # type: ignore[index] + font = findfont(prop) + self.fontmap['mathfont'] = font + + _slanted_symbols = set(r"\int \oint".split()) + + def _get_font(self, font: str | int) -> FT2Font: + # work around, since we only populate 'mathfont' in the fontmap + if font not in ('default', 'regular'): + font = 'mathfont' + + return super()._get_font(font) + + def _get_glyph(self, fontname: str, font_class: str, + sym: str) -> tuple[FT2Font, CharacterCodeType, bool]: + # `fontname' is one of rm cal it tt sf bf bfit default bb frak scr regular + # font_class is not currently supported + + # 1) map symbol to unicode index + try: + uniindex = get_unicode_index(sym) + found_symbol = True + except ValueError: + uniindex = ord('?') + found_symbol = False + _log.warning("No TeX to Unicode mapping for %a.", sym) + + if fontname in ('default', 'regular'): + slanted = False + font = self._get_font(fontname) + return font, uniindex, slanted + + # 2) remap unicode index based on fontname and font_class (bf, it, ...) + # Unicode mathematical alphanumeric symbols define all (relevant) variants + + # from here on: use the Math font + new_fontname = 'mathfont' + + def _is_digit(codepoint: CharacterCodeType) -> bool: + return 0x30 <= codepoint <= 0x39 + + def _is_latin_uppercase(codepoint: CharacterCodeType) -> bool: + return 0x41 <= codepoint <= 0x5a + + def _is_latin_lowercase(codepoint: CharacterCodeType) -> bool: + return 0x61 <= codepoint <= 0x7a + + def _is_greek_uppercase(codepoint: CharacterCodeType) -> bool: + return codepoint in greek_uppercase_domain + + def _is_greek_lowercase(codepoint: CharacterCodeType) -> bool: + return codepoint in greek_lowercase_domain + + # check if character is digit, latin letter, or greek letter + if _is_digit(uniindex): + # handle digits + _alphabet_map = { + 'rm': 'up', + 'it': 'up', # convention! digits always upright - not handled in Parser + 'tt': 'tt', + 'sf': 'sfup', + 'bf': 'bfup', + 'bfit': 'bfup', + 'bb': 'bb', + } + alphabet = _alphabet_map.get(fontname, 'up') + alphabet_lut = unicode_math_lut.get(alphabet, {}) + new_uniindex = alphabet_lut.get(uniindex, uniindex) + elif _is_latin_uppercase(uniindex) or _is_latin_lowercase(uniindex): + _alphabet_map = { + 'rm': 'up', + 'cal': 'scr', + 'it': 'it', + 'tt': 'tt', + 'sf': 'sfup', + 'bf': 'bfup', + 'bfit': 'bfit', + 'bb': 'bb', + 'frak': 'frak', + 'scr': 'scr' + } + alphabet = _alphabet_map.get(fontname, 'up') + alphabet_lut = unicode_math_lut.get(alphabet, {}) + new_uniindex = alphabet_lut.get(uniindex, uniindex) + elif _is_greek_uppercase(uniindex) or _is_greek_lowercase(uniindex): + _alphabet_map = { + 'rm': 'up', + 'it': 'it', + 'bf': 'bfup', + 'bfit': 'bfit', + } + alphabet = _alphabet_map.get(fontname, 'up') + alphabet_lut = unicode_math_lut.get(alphabet, {}) + new_uniindex = alphabet_lut.get(uniindex, uniindex) + else: + alphabet = 'up' + new_uniindex = uniindex + + slanted = (alphabet == 'it') or sym in self._slanted_symbols + font = self._get_font(new_fontname) + + return font, new_uniindex, slanted + + class StixFonts(UnicodeFonts): """ A font handling class for the STIX fonts. diff --git a/lib/matplotlib/_mathtext_data.py b/lib/matplotlib/_mathtext_data.py index f8b7c9ac2c33..036033278455 100644 --- a/lib/matplotlib/_mathtext_data.py +++ b/lib/matplotlib/_mathtext_data.py @@ -1815,3 +1815,1242 @@ def _normalize_stix_fontcodes(d): 0x22d2: 0x22d3, 0x22d3: 0x22d2, } + +unicode_math_lut: dict[str, dict[CharacterCodeType, CharacterCodeType]] = { + 'up': { + # digits + 0x30: 0x30, # 0 -> 0 + 0x31: 0x31, # 1 -> 1 + 0x32: 0x32, # 2 -> 2 + 0x33: 0x33, # 3 -> 3 + 0x34: 0x34, # 4 -> 4 + 0x35: 0x35, # 5 -> 5 + 0x36: 0x36, # 6 -> 6 + 0x37: 0x37, # 7 -> 7 + 0x38: 0x38, # 8 -> 8 + 0x39: 0x39, # 9 -> 9 + # latin upper case + 0x41: 0x41, # A -> A + 0x42: 0x42, # B -> B + 0x43: 0x43, # C -> C + 0x44: 0x44, # D -> D + 0x45: 0x45, # E -> E + 0x46: 0x46, # F -> F + 0x47: 0x47, # G -> G + 0x48: 0x48, # H -> H + 0x49: 0x49, # I -> I + 0x4a: 0x4a, # J -> J + 0x4b: 0x4b, # K -> K + 0x4c: 0x4c, # L -> L + 0x4d: 0x4d, # M -> M + 0x4e: 0x4e, # N -> N + 0x4f: 0x4f, # O -> O + 0x50: 0x50, # P -> P + 0x51: 0x51, # Q -> Q + 0x52: 0x52, # R -> R + 0x53: 0x53, # S -> S + 0x54: 0x54, # T -> T + 0x55: 0x55, # U -> U + 0x56: 0x56, # V -> V + 0x57: 0x57, # W -> W + 0x58: 0x58, # X -> X + 0x59: 0x59, # Y -> Y + 0x5a: 0x5a, # Z -> Z + # latin lower case + 0x61: 0x61, # a -> a + 0x62: 0x62, # b -> b + 0x63: 0x63, # c -> c + 0x64: 0x64, # d -> d + 0x65: 0x65, # e -> e + 0x66: 0x66, # f -> f + 0x67: 0x67, # g -> g + 0x68: 0x68, # h -> h + 0x69: 0x69, # i -> i + 0x6a: 0x6a, # j -> j + 0x6b: 0x6b, # k -> k + 0x6c: 0x6c, # l -> l + 0x6d: 0x6d, # m -> m + 0x6e: 0x6e, # n -> n + 0x6f: 0x6f, # o -> o + 0x70: 0x70, # p -> p + 0x71: 0x71, # q -> q + 0x72: 0x72, # r -> r + 0x73: 0x73, # s -> s + 0x74: 0x74, # t -> t + 0x75: 0x75, # u -> u + 0x76: 0x76, # v -> v + 0x77: 0x77, # w -> w + 0x78: 0x78, # x -> x + 0x79: 0x79, # y -> y + 0x7a: 0x7a, # z -> z + # greek upper case + 0x391: 0x391, # Α -> Α + 0x392: 0x392, # Β -> Β + 0x393: 0x393, # Γ -> Γ + 0x394: 0x394, # Δ -> Δ + 0x395: 0x395, # Ε -> Ε + 0x396: 0x396, # Ζ -> Ζ + 0x397: 0x397, # Η -> Η + 0x398: 0x398, # Θ -> Θ + 0x399: 0x399, # Ι -> Ι + 0x39a: 0x39a, # Κ -> Κ + 0x39b: 0x39b, # Λ -> Λ + 0x39c: 0x39c, # Μ -> Μ + 0x39d: 0x39d, # Ν -> Ν + 0x39e: 0x39e, # Ξ -> Ξ + 0x39f: 0x39f, # Ο -> Ο + 0x3a0: 0x3a0, # Π -> Π + 0x3a1: 0x3a1, # Ρ -> Ρ + 0x3f4: 0x3f4, # ϴ -> ϴ + 0x3a3: 0x3a3, # Σ -> Σ + 0x3a4: 0x3a4, # Τ -> Τ + 0x3a5: 0x3a5, # Υ -> Υ + 0x3a6: 0x3a6, # Φ -> Φ + 0x3a7: 0x3a7, # Χ -> Χ + 0x3a8: 0x3a8, # Ψ -> Ψ + 0x3a9: 0x3a9, # Ω -> Ω + # greek lower case + 0x3b1: 0x3b1, # α -> α + 0x3b2: 0x3b2, # β -> β + 0x3b3: 0x3b3, # γ -> γ + 0x3b4: 0x3b4, # δ -> δ + 0x3b5: 0x3b5, # ε -> ε + 0x3b6: 0x3b6, # ζ -> ζ + 0x3b7: 0x3b7, # η -> η + 0x3b8: 0x3b8, # θ -> θ + 0x3b9: 0x3b9, # ι -> ι + 0x3ba: 0x3ba, # κ -> κ + 0x3bb: 0x3bb, # λ -> λ + 0x3bc: 0x3bc, # μ -> μ + 0x3bd: 0x3bd, # ν -> ν + 0x3be: 0x3be, # ξ -> ξ + 0x3bf: 0x3bf, # ο -> ο + 0x3c0: 0x3c0, # π -> π + 0x3c1: 0x3c1, # ρ -> ρ + 0x3c2: 0x3c2, # ς -> ς + 0x3c3: 0x3c3, # σ -> σ + 0x3c4: 0x3c4, # τ -> τ + 0x3c5: 0x3c5, # υ -> υ + 0x3c6: 0x3c6, # φ -> φ + 0x3c7: 0x3c7, # χ -> χ + 0x3c8: 0x3c8, # ψ -> ψ + 0x3c9: 0x3c9, # ω -> ω + 0x2202: 0x2202, # ∂ -> ∂ + 0x3f5: 0x3f5, # ϵ -> ϵ + 0x3d1: 0x3d1, # ϑ -> ϑ + 0x3f0: 0x3f0, # ϰ -> ϰ + 0x3f1: 0x3d5, # ϱ -> ϕ + 0x3cf: 0x3f1, # Ϗ -> ϱ + 0x3d6: 0x3d6, # ϖ -> ϖ + }, + 'bfup': { + # digits + 0x30: 0x1d7ce, # 0 -> 𝟎 + 0x31: 0x1d7cf, # 1 -> 𝟏 + 0x32: 0x1d7d0, # 2 -> 𝟐 + 0x33: 0x1d7d1, # 3 -> 𝟑 + 0x34: 0x1d7d2, # 4 -> 𝟒 + 0x35: 0x1d7d3, # 5 -> 𝟓 + 0x36: 0x1d7d4, # 6 -> 𝟔 + 0x37: 0x1d7d5, # 7 -> 𝟕 + 0x38: 0x1d7d6, # 8 -> 𝟖 + 0x39: 0x1d7d7, # 9 -> 𝟗 + # latin upper case + 0x41: 0x1d400, # A -> 𝐀 + 0x42: 0x1d401, # B -> 𝐁 + 0x43: 0x1d402, # C -> 𝐂 + 0x44: 0x1d403, # D -> 𝐃 + 0x45: 0x1d404, # E -> 𝐄 + 0x46: 0x1d405, # F -> 𝐅 + 0x47: 0x1d406, # G -> 𝐆 + 0x48: 0x1d407, # H -> 𝐇 + 0x49: 0x1d408, # I -> 𝐈 + 0x4a: 0x1d409, # J -> 𝐉 + 0x4b: 0x1d40a, # K -> 𝐊 + 0x4c: 0x1d40b, # L -> 𝐋 + 0x4d: 0x1d40c, # M -> 𝐌 + 0x4e: 0x1d40d, # N -> 𝐍 + 0x4f: 0x1d40e, # O -> 𝐎 + 0x50: 0x1d40f, # P -> 𝐏 + 0x51: 0x1d410, # Q -> 𝐐 + 0x52: 0x1d411, # R -> 𝐑 + 0x53: 0x1d412, # S -> 𝐒 + 0x54: 0x1d413, # T -> 𝐓 + 0x55: 0x1d414, # U -> 𝐔 + 0x56: 0x1d415, # V -> 𝐕 + 0x57: 0x1d416, # W -> 𝐖 + 0x58: 0x1d417, # X -> 𝐗 + 0x59: 0x1d418, # Y -> 𝐘 + 0x5a: 0x1d419, # Z -> 𝐙 + # latin lower case + 0x61: 0x1d41a, # a -> 𝐚 + 0x62: 0x1d41b, # b -> 𝐛 + 0x63: 0x1d41c, # c -> 𝐜 + 0x64: 0x1d41d, # d -> 𝐝 + 0x65: 0x1d41e, # e -> 𝐞 + 0x66: 0x1d41f, # f -> 𝐟 + 0x67: 0x1d420, # g -> 𝐠 + 0x68: 0x1d421, # h -> 𝐡 + 0x69: 0x1d422, # i -> 𝐢 + 0x6a: 0x1d423, # j -> 𝐣 + 0x6b: 0x1d424, # k -> 𝐤 + 0x6c: 0x1d425, # l -> 𝐥 + 0x6d: 0x1d426, # m -> 𝐦 + 0x6e: 0x1d427, # n -> 𝐧 + 0x6f: 0x1d428, # o -> 𝐨 + 0x70: 0x1d429, # p -> 𝐩 + 0x71: 0x1d42a, # q -> 𝐪 + 0x72: 0x1d42b, # r -> 𝐫 + 0x73: 0x1d42c, # s -> 𝐬 + 0x74: 0x1d42d, # t -> 𝐭 + 0x75: 0x1d42e, # u -> 𝐮 + 0x76: 0x1d42f, # v -> 𝐯 + 0x77: 0x1d430, # w -> 𝐰 + 0x78: 0x1d431, # x -> 𝐱 + 0x79: 0x1d432, # y -> 𝐲 + 0x7a: 0x1d433, # z -> 𝐳 + # greek upper case + 0x391: 0x1d6a8, # Α -> 𝚨 + 0x392: 0x1d6a9, # Β -> 𝚩 + 0x393: 0x1d6aa, # Γ -> 𝚪 + 0x394: 0x1d6ab, # Δ -> 𝚫 + 0x395: 0x1d6ac, # Ε -> 𝚬 + 0x396: 0x1d6ad, # Ζ -> 𝚭 + 0x397: 0x1d6ae, # Η -> 𝚮 + 0x398: 0x1d6af, # Θ -> 𝚯 + 0x399: 0x1d6b0, # Ι -> 𝚰 + 0x39a: 0x1d6b1, # Κ -> 𝚱 + 0x39b: 0x1d6b2, # Λ -> 𝚲 + 0x39c: 0x1d6b3, # Μ -> 𝚳 + 0x39d: 0x1d6b4, # Ν -> 𝚴 + 0x39e: 0x1d6b5, # Ξ -> 𝚵 + 0x39f: 0x1d6b6, # Ο -> 𝚶 + 0x3a0: 0x1d6b7, # Π -> 𝚷 + 0x3a1: 0x1d6b8, # Ρ -> 𝚸 + 0x3f4: 0x1d6b9, # ϴ -> 𝚹 + 0x3a3: 0x1d6ba, # Σ -> 𝚺 + 0x3a4: 0x1d6bb, # Τ -> 𝚻 + 0x3a5: 0x1d6bc, # Υ -> 𝚼 + 0x3a6: 0x1d6bd, # Φ -> 𝚽 + 0x3a7: 0x1d6be, # Χ -> 𝚾 + 0x3a8: 0x1d6bf, # Ψ -> 𝚿 + 0x3a9: 0x1d6c0, # Ω -> 𝛀 + # greek lower case + 0x3b1: 0x1d6c2, # α -> 𝛂 + 0x3b2: 0x1d6c3, # β -> 𝛃 + 0x3b3: 0x1d6c4, # γ -> 𝛄 + 0x3b4: 0x1d6c5, # δ -> 𝛅 + 0x3b5: 0x1d6c6, # ε -> 𝛆 + 0x3b6: 0x1d6c7, # ζ -> 𝛇 + 0x3b7: 0x1d6c8, # η -> 𝛈 + 0x3b8: 0x1d6c9, # θ -> 𝛉 + 0x3b9: 0x1d6ca, # ι -> 𝛊 + 0x3ba: 0x1d6cb, # κ -> 𝛋 + 0x3bb: 0x1d6cc, # λ -> 𝛌 + 0x3bc: 0x1d6cd, # μ -> 𝛍 + 0x3bd: 0x1d6ce, # ν -> 𝛎 + 0x3be: 0x1d6cf, # ξ -> 𝛏 + 0x3bf: 0x1d6d0, # ο -> 𝛐 + 0x3c0: 0x1d6d1, # π -> 𝛑 + 0x3c1: 0x1d6d2, # ρ -> 𝛒 + 0x3c2: 0x1d6d3, # ς -> 𝛓 + 0x3c3: 0x1d6d4, # σ -> 𝛔 + 0x3c4: 0x1d6d5, # τ -> 𝛕 + 0x3c5: 0x1d6d6, # υ -> 𝛖 + 0x3c6: 0x1d6d7, # φ -> 𝛗 + 0x3c7: 0x1d6d8, # χ -> 𝛘 + 0x3c8: 0x1d6d9, # ψ -> 𝛙 + 0x3c9: 0x1d6da, # ω -> 𝛚 + 0x2202: 0x1d6db, # ∂ -> 𝛛 + 0x3f5: 0x1d6dc, # ϵ -> 𝛜 + 0x3d1: 0x1d6dd, # ϑ -> 𝛝 + 0x3f0: 0x1d6de, # ϰ -> 𝛞 + 0x3f1: 0x1d6df, # ϱ -> 𝛟 + 0x3cf: 0x1d6e0, # Ϗ -> 𝛠 + 0x3d6: 0x1d6e1, # ϖ -> 𝛡 + }, + 'it': { + # digits + # latin upper case + 0x41: 0x1d434, # A -> 𝐴 + 0x42: 0x1d435, # B -> 𝐵 + 0x43: 0x1d436, # C -> 𝐶 + 0x44: 0x1d437, # D -> 𝐷 + 0x45: 0x1d438, # E -> 𝐸 + 0x46: 0x1d439, # F -> 𝐹 + 0x47: 0x1d43a, # G -> 𝐺 + 0x48: 0x1d43b, # H -> 𝐻 + 0x49: 0x1d43c, # I -> 𝐼 + 0x4a: 0x1d43d, # J -> 𝐽 + 0x4b: 0x1d43e, # K -> 𝐾 + 0x4c: 0x1d43f, # L -> 𝐿 + 0x4d: 0x1d440, # M -> 𝑀 + 0x4e: 0x1d441, # N -> 𝑁 + 0x4f: 0x1d442, # O -> 𝑂 + 0x50: 0x1d443, # P -> 𝑃 + 0x51: 0x1d444, # Q -> 𝑄 + 0x52: 0x1d445, # R -> 𝑅 + 0x53: 0x1d446, # S -> 𝑆 + 0x54: 0x1d447, # T -> 𝑇 + 0x55: 0x1d448, # U -> 𝑈 + 0x56: 0x1d449, # V -> 𝑉 + 0x57: 0x1d44a, # W -> 𝑊 + 0x58: 0x1d44b, # X -> 𝑋 + 0x59: 0x1d44c, # Y -> 𝑌 + 0x5a: 0x1d44d, # Z -> 𝑍 + # latin lower case + 0x61: 0x1d44e, # a -> 𝑎 + 0x62: 0x1d44f, # b -> 𝑏 + 0x63: 0x1d450, # c -> 𝑐 + 0x64: 0x1d451, # d -> 𝑑 + 0x65: 0x1d452, # e -> 𝑒 + 0x66: 0x1d453, # f -> 𝑓 + 0x67: 0x1d454, # g -> 𝑔 + 0x68: 0x210e, # h -> ℎ + 0x69: 0x1d456, # i -> 𝑖 + 0x6a: 0x1d457, # j -> 𝑗 + 0x6b: 0x1d458, # k -> 𝑘 + 0x6c: 0x1d459, # l -> 𝑙 + 0x6d: 0x1d45a, # m -> 𝑚 + 0x6e: 0x1d45b, # n -> 𝑛 + 0x6f: 0x1d45c, # o -> 𝑜 + 0x70: 0x1d45d, # p -> 𝑝 + 0x71: 0x1d45e, # q -> 𝑞 + 0x72: 0x1d45f, # r -> 𝑟 + 0x73: 0x1d460, # s -> 𝑠 + 0x74: 0x1d461, # t -> 𝑡 + 0x75: 0x1d462, # u -> 𝑢 + 0x76: 0x1d463, # v -> 𝑣 + 0x77: 0x1d464, # w -> 𝑤 + 0x78: 0x1d465, # x -> 𝑥 + 0x79: 0x1d466, # y -> 𝑦 + 0x7a: 0x1d467, # z -> 𝑧 + # greek upper case + 0x391: 0x1d6e2, # Α -> 𝛢 + 0x392: 0x1d6e3, # Β -> 𝛣 + 0x393: 0x1d6e4, # Γ -> 𝛤 + 0x394: 0x1d6e5, # Δ -> 𝛥 + 0x395: 0x1d6e6, # Ε -> 𝛦 + 0x396: 0x1d6e7, # Ζ -> 𝛧 + 0x397: 0x1d6e8, # Η -> 𝛨 + 0x398: 0x1d6e9, # Θ -> 𝛩 + 0x399: 0x1d6ea, # Ι -> 𝛪 + 0x39a: 0x1d6eb, # Κ -> 𝛫 + 0x39b: 0x1d6ec, # Λ -> 𝛬 + 0x39c: 0x1d6ed, # Μ -> 𝛭 + 0x39d: 0x1d6ee, # Ν -> 𝛮 + 0x39e: 0x1d6ef, # Ξ -> 𝛯 + 0x39f: 0x1d6f0, # Ο -> 𝛰 + 0x3a0: 0x1d6f1, # Π -> 𝛱 + 0x3a1: 0x1d6f2, # Ρ -> 𝛲 + 0x3f4: 0x1d6f3, # ϴ -> 𝛳 + 0x3a3: 0x1d6f4, # Σ -> 𝛴 + 0x3a4: 0x1d6f5, # Τ -> 𝛵 + 0x3a5: 0x1d6f6, # Υ -> 𝛶 + 0x3a6: 0x1d6f7, # Φ -> 𝛷 + 0x3a7: 0x1d6f8, # Χ -> 𝛸 + 0x3a8: 0x1d6f9, # Ψ -> 𝛹 + 0x3a9: 0x1d6fa, # Ω -> 𝛺 + # greek lower case + 0x3b1: 0x1d6fc, # α -> 𝛼 + 0x3b2: 0x1d6fd, # β -> 𝛽 + 0x3b3: 0x1d6fe, # γ -> 𝛾 + 0x3b4: 0x1d6ff, # δ -> 𝛿 + 0x3b5: 0x1d700, # ε -> 𝜀 + 0x3b6: 0x1d701, # ζ -> 𝜁 + 0x3b7: 0x1d702, # η -> 𝜂 + 0x3b8: 0x1d703, # θ -> 𝜃 + 0x3b9: 0x1d704, # ι -> 𝜄 + 0x3ba: 0x1d705, # κ -> 𝜅 + 0x3bb: 0x1d706, # λ -> 𝜆 + 0x3bc: 0x1d707, # μ -> 𝜇 + 0x3bd: 0x1d708, # ν -> 𝜈 + 0x3be: 0x1d709, # ξ -> 𝜉 + 0x3bf: 0x1d70a, # ο -> 𝜊 + 0x3c0: 0x1d70b, # π -> 𝜋 + 0x3c1: 0x1d70c, # ρ -> 𝜌 + 0x3c2: 0x1d70d, # ς -> 𝜍 + 0x3c3: 0x1d70e, # σ -> 𝜎 + 0x3c4: 0x1d70f, # τ -> 𝜏 + 0x3c5: 0x1d710, # υ -> 𝜐 + 0x3c6: 0x1d711, # φ -> 𝜑 + 0x3c7: 0x1d712, # χ -> 𝜒 + 0x3c8: 0x1d713, # ψ -> 𝜓 + 0x3c9: 0x1d714, # ω -> 𝜔 + 0x2202: 0x1d715, # ∂ -> 𝜕 + 0x3f5: 0x1d716, # ϵ -> 𝜖 + 0x3d1: 0x1d717, # ϑ -> 𝜗 + 0x3f0: 0x1d718, # ϰ -> 𝜘 + 0x3f1: 0x1d719, # ϱ -> 𝜙 + 0x3cf: 0x1d71a, # Ϗ -> 𝜚 + 0x3d6: 0x1d71b, # ϖ -> 𝜛 + }, + 'bfit': { + # digits + # latin upper case + 0x41: 0x1d468, # A -> 𝑨 + 0x42: 0x1d469, # B -> 𝑩 + 0x43: 0x1d46a, # C -> 𝑪 + 0x44: 0x1d46b, # D -> 𝑫 + 0x45: 0x1d46c, # E -> 𝑬 + 0x46: 0x1d46d, # F -> 𝑭 + 0x47: 0x1d46e, # G -> 𝑮 + 0x48: 0x1d46f, # H -> 𝑯 + 0x49: 0x1d470, # I -> 𝑰 + 0x4a: 0x1d471, # J -> 𝑱 + 0x4b: 0x1d472, # K -> 𝑲 + 0x4c: 0x1d473, # L -> 𝑳 + 0x4d: 0x1d474, # M -> 𝑴 + 0x4e: 0x1d475, # N -> 𝑵 + 0x4f: 0x1d476, # O -> 𝑶 + 0x50: 0x1d477, # P -> 𝑷 + 0x51: 0x1d478, # Q -> 𝑸 + 0x52: 0x1d479, # R -> 𝑹 + 0x53: 0x1d47a, # S -> 𝑺 + 0x54: 0x1d47b, # T -> 𝑻 + 0x55: 0x1d47c, # U -> 𝑼 + 0x56: 0x1d47d, # V -> 𝑽 + 0x57: 0x1d47e, # W -> 𝑾 + 0x58: 0x1d47f, # X -> 𝑿 + 0x59: 0x1d480, # Y -> 𝒀 + 0x5a: 0x1d481, # Z -> 𝒁 + # latin lower case + 0x61: 0x1d482, # a -> 𝒂 + 0x62: 0x1d483, # b -> 𝒃 + 0x63: 0x1d484, # c -> 𝒄 + 0x64: 0x1d485, # d -> 𝒅 + 0x65: 0x1d486, # e -> 𝒆 + 0x66: 0x1d487, # f -> 𝒇 + 0x67: 0x1d488, # g -> 𝒈 + 0x68: 0x1d489, # h -> 𝒉 + 0x69: 0x1d48a, # i -> 𝒊 + 0x6a: 0x1d48b, # j -> 𝒋 + 0x6b: 0x1d48c, # k -> 𝒌 + 0x6c: 0x1d48d, # l -> 𝒍 + 0x6d: 0x1d48e, # m -> 𝒎 + 0x6e: 0x1d48f, # n -> 𝒏 + 0x6f: 0x1d490, # o -> 𝒐 + 0x70: 0x1d491, # p -> 𝒑 + 0x71: 0x1d492, # q -> 𝒒 + 0x72: 0x1d493, # r -> 𝒓 + 0x73: 0x1d494, # s -> 𝒔 + 0x74: 0x1d495, # t -> 𝒕 + 0x75: 0x1d496, # u -> 𝒖 + 0x76: 0x1d497, # v -> 𝒗 + 0x77: 0x1d498, # w -> 𝒘 + 0x78: 0x1d499, # x -> 𝒙 + 0x79: 0x1d49a, # y -> 𝒚 + 0x7a: 0x1d49b, # z -> 𝒛 + # greek upper case + 0x391: 0x1d71c, # Α -> 𝜜 + 0x392: 0x1d71d, # Β -> 𝜝 + 0x393: 0x1d71e, # Γ -> 𝜞 + 0x394: 0x1d71f, # Δ -> 𝜟 + 0x395: 0x1d720, # Ε -> 𝜠 + 0x396: 0x1d721, # Ζ -> 𝜡 + 0x397: 0x1d722, # Η -> 𝜢 + 0x398: 0x1d723, # Θ -> 𝜣 + 0x399: 0x1d724, # Ι -> 𝜤 + 0x39a: 0x1d725, # Κ -> 𝜥 + 0x39b: 0x1d726, # Λ -> 𝜦 + 0x39c: 0x1d727, # Μ -> 𝜧 + 0x39d: 0x1d728, # Ν -> 𝜨 + 0x39e: 0x1d729, # Ξ -> 𝜩 + 0x39f: 0x1d72a, # Ο -> 𝜪 + 0x3a0: 0x1d72b, # Π -> 𝜫 + 0x3a1: 0x1d72c, # Ρ -> 𝜬 + 0x3f4: 0x1d72d, # ϴ -> 𝜭 + 0x3a3: 0x1d72e, # Σ -> 𝜮 + 0x3a4: 0x1d72f, # Τ -> 𝜯 + 0x3a5: 0x1d730, # Υ -> 𝜰 + 0x3a6: 0x1d731, # Φ -> 𝜱 + 0x3a7: 0x1d732, # Χ -> 𝜲 + 0x3a8: 0x1d733, # Ψ -> 𝜳 + 0x3a9: 0x1d734, # Ω -> 𝜴 + # greek lower case + 0x3b1: 0x1d736, # α -> 𝜶 + 0x3b2: 0x1d737, # β -> 𝜷 + 0x3b3: 0x1d738, # γ -> 𝜸 + 0x3b4: 0x1d739, # δ -> 𝜹 + 0x3b5: 0x1d73a, # ε -> 𝜺 + 0x3b6: 0x1d73b, # ζ -> 𝜻 + 0x3b7: 0x1d73c, # η -> 𝜼 + 0x3b8: 0x1d73d, # θ -> 𝜽 + 0x3b9: 0x1d73e, # ι -> 𝜾 + 0x3ba: 0x1d73f, # κ -> 𝜿 + 0x3bb: 0x1d740, # λ -> 𝝀 + 0x3bc: 0x1d741, # μ -> 𝝁 + 0x3bd: 0x1d742, # ν -> 𝝂 + 0x3be: 0x1d743, # ξ -> 𝝃 + 0x3bf: 0x1d744, # ο -> 𝝄 + 0x3c0: 0x1d745, # π -> 𝝅 + 0x3c1: 0x1d746, # ρ -> 𝝆 + 0x3c2: 0x1d747, # ς -> 𝝇 + 0x3c3: 0x1d748, # σ -> 𝝈 + 0x3c4: 0x1d749, # τ -> 𝝉 + 0x3c5: 0x1d74a, # υ -> 𝝊 + 0x3c6: 0x1d74b, # φ -> 𝝋 + 0x3c7: 0x1d74c, # χ -> 𝝌 + 0x3c8: 0x1d74d, # ψ -> 𝝍 + 0x3c9: 0x1d74e, # ω -> 𝝎 + 0x2202: 0x1d74f, # ∂ -> 𝝏 + 0x3f5: 0x1d750, # ϵ -> 𝝐 + 0x3d1: 0x1d751, # ϑ -> 𝝑 + 0x3f0: 0x1d752, # ϰ -> 𝝒 + 0x3f1: 0x1d753, # ϱ -> 𝝓 + 0x3cf: 0x1d754, # Ϗ -> 𝝔 + 0x3d6: 0x1d755, # ϖ -> 𝝕 + }, + 'sfup': { + # digits + 0x30: 0x1d7e2, # 0 -> 𝟢 + 0x31: 0x1d7e3, # 1 -> 𝟣 + 0x32: 0x1d7e4, # 2 -> 𝟤 + 0x33: 0x1d7e5, # 3 -> 𝟥 + 0x34: 0x1d7e6, # 4 -> 𝟦 + 0x35: 0x1d7e7, # 5 -> 𝟧 + 0x36: 0x1d7e8, # 6 -> 𝟨 + 0x37: 0x1d7e9, # 7 -> 𝟩 + 0x38: 0x1d7ea, # 8 -> 𝟪 + 0x39: 0x1d7eb, # 9 -> 𝟫 + # latin upper case + 0x41: 0x1d5a0, # A -> 𝖠 + 0x42: 0x1d5a1, # B -> 𝖡 + 0x43: 0x1d5a2, # C -> 𝖢 + 0x44: 0x1d5a3, # D -> 𝖣 + 0x45: 0x1d5a4, # E -> 𝖤 + 0x46: 0x1d5a5, # F -> 𝖥 + 0x47: 0x1d5a6, # G -> 𝖦 + 0x48: 0x1d5a7, # H -> 𝖧 + 0x49: 0x1d5a8, # I -> 𝖨 + 0x4a: 0x1d5a9, # J -> 𝖩 + 0x4b: 0x1d5aa, # K -> 𝖪 + 0x4c: 0x1d5ab, # L -> 𝖫 + 0x4d: 0x1d5ac, # M -> 𝖬 + 0x4e: 0x1d5ad, # N -> 𝖭 + 0x4f: 0x1d5ae, # O -> 𝖮 + 0x50: 0x1d5af, # P -> 𝖯 + 0x51: 0x1d5b0, # Q -> 𝖰 + 0x52: 0x1d5b1, # R -> 𝖱 + 0x53: 0x1d5b2, # S -> 𝖲 + 0x54: 0x1d5b3, # T -> 𝖳 + 0x55: 0x1d5b4, # U -> 𝖴 + 0x56: 0x1d5b5, # V -> 𝖵 + 0x57: 0x1d5b6, # W -> 𝖶 + 0x58: 0x1d5b7, # X -> 𝖷 + 0x59: 0x1d5b8, # Y -> 𝖸 + 0x5a: 0x1d5b9, # Z -> 𝖹 + # latin lower case + 0x61: 0x1d5ba, # a -> 𝖺 + 0x62: 0x1d5bb, # b -> 𝖻 + 0x63: 0x1d5bc, # c -> 𝖼 + 0x64: 0x1d5bd, # d -> 𝖽 + 0x65: 0x1d5be, # e -> 𝖾 + 0x66: 0x1d5bf, # f -> 𝖿 + 0x67: 0x1d5c0, # g -> 𝗀 + 0x68: 0x1d5c1, # h -> 𝗁 + 0x69: 0x1d5c2, # i -> 𝗂 + 0x6a: 0x1d5c3, # j -> 𝗃 + 0x6b: 0x1d5c4, # k -> 𝗄 + 0x6c: 0x1d5c5, # l -> 𝗅 + 0x6d: 0x1d5c6, # m -> 𝗆 + 0x6e: 0x1d5c7, # n -> 𝗇 + 0x6f: 0x1d5c8, # o -> 𝗈 + 0x70: 0x1d5c9, # p -> 𝗉 + 0x71: 0x1d5ca, # q -> 𝗊 + 0x72: 0x1d5cb, # r -> 𝗋 + 0x73: 0x1d5cc, # s -> 𝗌 + 0x74: 0x1d5cd, # t -> 𝗍 + 0x75: 0x1d5ce, # u -> 𝗎 + 0x76: 0x1d5cf, # v -> 𝗏 + 0x77: 0x1d5d0, # w -> 𝗐 + 0x78: 0x1d5d1, # x -> 𝗑 + 0x79: 0x1d5d2, # y -> 𝗒 + 0x7a: 0x1d5d3, # z -> 𝗓 + # greek upper case + # greek lower case + }, + 'bfsfup': { + # digits + 0x30: 0x1d7ec, # 0 -> 𝟬 + 0x31: 0x1d7ed, # 1 -> 𝟭 + 0x32: 0x1d7ee, # 2 -> 𝟮 + 0x33: 0x1d7ef, # 3 -> 𝟯 + 0x34: 0x1d7f0, # 4 -> 𝟰 + 0x35: 0x1d7f1, # 5 -> 𝟱 + 0x36: 0x1d7f2, # 6 -> 𝟲 + 0x37: 0x1d7f3, # 7 -> 𝟳 + 0x38: 0x1d7f4, # 8 -> 𝟴 + 0x39: 0x1d7f5, # 9 -> 𝟵 + # latin upper case + 0x41: 0x1d5d4, # A -> 𝗔 + 0x42: 0x1d5d5, # B -> 𝗕 + 0x43: 0x1d5d6, # C -> 𝗖 + 0x44: 0x1d5d7, # D -> 𝗗 + 0x45: 0x1d5d8, # E -> 𝗘 + 0x46: 0x1d5d9, # F -> 𝗙 + 0x47: 0x1d5da, # G -> 𝗚 + 0x48: 0x1d5db, # H -> 𝗛 + 0x49: 0x1d5dc, # I -> 𝗜 + 0x4a: 0x1d5dd, # J -> 𝗝 + 0x4b: 0x1d5de, # K -> 𝗞 + 0x4c: 0x1d5df, # L -> 𝗟 + 0x4d: 0x1d5e0, # M -> 𝗠 + 0x4e: 0x1d5e1, # N -> 𝗡 + 0x4f: 0x1d5e2, # O -> 𝗢 + 0x50: 0x1d5e3, # P -> 𝗣 + 0x51: 0x1d5e4, # Q -> 𝗤 + 0x52: 0x1d5e5, # R -> 𝗥 + 0x53: 0x1d5e6, # S -> 𝗦 + 0x54: 0x1d5e7, # T -> 𝗧 + 0x55: 0x1d5e8, # U -> 𝗨 + 0x56: 0x1d5e9, # V -> 𝗩 + 0x57: 0x1d5ea, # W -> 𝗪 + 0x58: 0x1d5eb, # X -> 𝗫 + 0x59: 0x1d5ec, # Y -> 𝗬 + 0x5a: 0x1d5ed, # Z -> 𝗭 + # latin lower case + 0x61: 0x1d5ee, # a -> 𝗮 + 0x62: 0x1d5ef, # b -> 𝗯 + 0x63: 0x1d5f0, # c -> 𝗰 + 0x64: 0x1d5f1, # d -> 𝗱 + 0x65: 0x1d5f2, # e -> 𝗲 + 0x66: 0x1d5f3, # f -> 𝗳 + 0x67: 0x1d5f4, # g -> 𝗴 + 0x68: 0x1d5f5, # h -> 𝗵 + 0x69: 0x1d5f6, # i -> 𝗶 + 0x6a: 0x1d5f7, # j -> 𝗷 + 0x6b: 0x1d5f8, # k -> 𝗸 + 0x6c: 0x1d5f9, # l -> 𝗹 + 0x6d: 0x1d5fa, # m -> 𝗺 + 0x6e: 0x1d5fb, # n -> 𝗻 + 0x6f: 0x1d5fc, # o -> 𝗼 + 0x70: 0x1d5fd, # p -> 𝗽 + 0x71: 0x1d5fe, # q -> 𝗾 + 0x72: 0x1d5ff, # r -> 𝗿 + 0x73: 0x1d600, # s -> 𝘀 + 0x74: 0x1d601, # t -> 𝘁 + 0x75: 0x1d602, # u -> 𝘂 + 0x76: 0x1d603, # v -> 𝘃 + 0x77: 0x1d604, # w -> 𝘄 + 0x78: 0x1d605, # x -> 𝘅 + 0x79: 0x1d606, # y -> 𝘆 + 0x7a: 0x1d607, # z -> 𝘇 + # greek upper case + 0x391: 0x1d756, # Α -> 𝝖 + 0x392: 0x1d757, # Β -> 𝝗 + 0x393: 0x1d758, # Γ -> 𝝘 + 0x394: 0x1d759, # Δ -> 𝝙 + 0x395: 0x1d75a, # Ε -> 𝝚 + 0x396: 0x1d75b, # Ζ -> 𝝛 + 0x397: 0x1d75c, # Η -> 𝝜 + 0x398: 0x1d75d, # Θ -> 𝝝 + 0x399: 0x1d75e, # Ι -> 𝝞 + 0x39a: 0x1d75f, # Κ -> 𝝟 + 0x39b: 0x1d760, # Λ -> 𝝠 + 0x39c: 0x1d761, # Μ -> 𝝡 + 0x39d: 0x1d762, # Ν -> 𝝢 + 0x39e: 0x1d763, # Ξ -> 𝝣 + 0x39f: 0x1d764, # Ο -> 𝝤 + 0x3a0: 0x1d765, # Π -> 𝝥 + 0x3a1: 0x1d766, # Ρ -> 𝝦 + 0x3f4: 0x1d767, # ϴ -> 𝝧 + 0x3a3: 0x1d768, # Σ -> 𝝨 + 0x3a4: 0x1d769, # Τ -> 𝝩 + 0x3a5: 0x1d76a, # Υ -> 𝝪 + 0x3a6: 0x1d76b, # Φ -> 𝝫 + 0x3a7: 0x1d76c, # Χ -> 𝝬 + 0x3a8: 0x1d76d, # Ψ -> 𝝭 + 0x3a9: 0x1d76e, # Ω -> 𝝮 + # greek lower case + 0x3b1: 0x1d770, # α -> 𝝰 + 0x3b2: 0x1d771, # β -> 𝝱 + 0x3b3: 0x1d772, # γ -> 𝝲 + 0x3b4: 0x1d773, # δ -> 𝝳 + 0x3b5: 0x1d774, # ε -> 𝝴 + 0x3b6: 0x1d775, # ζ -> 𝝵 + 0x3b7: 0x1d776, # η -> 𝝶 + 0x3b8: 0x1d777, # θ -> 𝝷 + 0x3b9: 0x1d778, # ι -> 𝝸 + 0x3ba: 0x1d779, # κ -> 𝝹 + 0x3bb: 0x1d77a, # λ -> 𝝺 + 0x3bc: 0x1d77b, # μ -> 𝝻 + 0x3bd: 0x1d77c, # ν -> 𝝼 + 0x3be: 0x1d77d, # ξ -> 𝝽 + 0x3bf: 0x1d77e, # ο -> 𝝾 + 0x3c0: 0x1d77f, # π -> 𝝿 + 0x3c1: 0x1d780, # ρ -> 𝞀 + 0x3c2: 0x1d781, # ς -> 𝞁 + 0x3c3: 0x1d782, # σ -> 𝞂 + 0x3c4: 0x1d783, # τ -> 𝞃 + 0x3c5: 0x1d784, # υ -> 𝞄 + 0x3c6: 0x1d785, # φ -> 𝞅 + 0x3c7: 0x1d786, # χ -> 𝞆 + 0x3c8: 0x1d787, # ψ -> 𝞇 + 0x3c9: 0x1d788, # ω -> 𝞈 + 0x2202: 0x1d789, # ∂ -> 𝞉 + 0x3f5: 0x1d78a, # ϵ -> 𝞊 + 0x3d1: 0x1d78b, # ϑ -> 𝞋 + 0x3f0: 0x1d78c, # ϰ -> 𝞌 + 0x3f1: 0x1d78d, # ϱ -> 𝞍 + 0x3cf: 0x1d78e, # Ϗ -> 𝞎 + 0x3d6: 0x1d78f, # ϖ -> 𝞏 + }, + 'sfit': { + # digits + # latin upper case + 0x41: 0x1d608, # A -> 𝘈 + 0x42: 0x1d609, # B -> 𝘉 + 0x43: 0x1d60a, # C -> 𝘊 + 0x44: 0x1d60b, # D -> 𝘋 + 0x45: 0x1d60c, # E -> 𝘌 + 0x46: 0x1d60d, # F -> 𝘍 + 0x47: 0x1d60e, # G -> 𝘎 + 0x48: 0x1d60f, # H -> 𝘏 + 0x49: 0x1d610, # I -> 𝘐 + 0x4a: 0x1d611, # J -> 𝘑 + 0x4b: 0x1d612, # K -> 𝘒 + 0x4c: 0x1d613, # L -> 𝘓 + 0x4d: 0x1d614, # M -> 𝘔 + 0x4e: 0x1d615, # N -> 𝘕 + 0x4f: 0x1d616, # O -> 𝘖 + 0x50: 0x1d617, # P -> 𝘗 + 0x51: 0x1d618, # Q -> 𝘘 + 0x52: 0x1d619, # R -> 𝘙 + 0x53: 0x1d61a, # S -> 𝘚 + 0x54: 0x1d61b, # T -> 𝘛 + 0x55: 0x1d61c, # U -> 𝘜 + 0x56: 0x1d61d, # V -> 𝘝 + 0x57: 0x1d61e, # W -> 𝘞 + 0x58: 0x1d61f, # X -> 𝘟 + 0x59: 0x1d620, # Y -> 𝘠 + 0x5a: 0x1d621, # Z -> 𝘡 + # latin lower case + 0x61: 0x1d622, # a -> 𝘢 + 0x62: 0x1d623, # b -> 𝘣 + 0x63: 0x1d624, # c -> 𝘤 + 0x64: 0x1d625, # d -> 𝘥 + 0x65: 0x1d626, # e -> 𝘦 + 0x66: 0x1d627, # f -> 𝘧 + 0x67: 0x1d628, # g -> 𝘨 + 0x68: 0x1d629, # h -> 𝘩 + 0x69: 0x1d62a, # i -> 𝘪 + 0x6a: 0x1d62b, # j -> 𝘫 + 0x6b: 0x1d62c, # k -> 𝘬 + 0x6c: 0x1d62d, # l -> 𝘭 + 0x6d: 0x1d62e, # m -> 𝘮 + 0x6e: 0x1d62f, # n -> 𝘯 + 0x6f: 0x1d630, # o -> 𝘰 + 0x70: 0x1d631, # p -> 𝘱 + 0x71: 0x1d632, # q -> 𝘲 + 0x72: 0x1d633, # r -> 𝘳 + 0x73: 0x1d634, # s -> 𝘴 + 0x74: 0x1d635, # t -> 𝘵 + 0x75: 0x1d636, # u -> 𝘶 + 0x76: 0x1d637, # v -> 𝘷 + 0x77: 0x1d638, # w -> 𝘸 + 0x78: 0x1d639, # x -> 𝘹 + 0x79: 0x1d63a, # y -> 𝘺 + 0x7a: 0x1d63b, # z -> 𝘻 + # greek upper case + # greek lower case + }, + 'bfsfit': { + # digits + # latin upper case + 0x41: 0x1d63c, # A -> 𝘼 + 0x42: 0x1d63d, # B -> 𝘽 + 0x43: 0x1d63e, # C -> 𝘾 + 0x44: 0x1d63f, # D -> 𝘿 + 0x45: 0x1d640, # E -> 𝙀 + 0x46: 0x1d641, # F -> 𝙁 + 0x47: 0x1d642, # G -> 𝙂 + 0x48: 0x1d643, # H -> 𝙃 + 0x49: 0x1d644, # I -> 𝙄 + 0x4a: 0x1d645, # J -> 𝙅 + 0x4b: 0x1d646, # K -> 𝙆 + 0x4c: 0x1d647, # L -> 𝙇 + 0x4d: 0x1d648, # M -> 𝙈 + 0x4e: 0x1d649, # N -> 𝙉 + 0x4f: 0x1d64a, # O -> 𝙊 + 0x50: 0x1d64b, # P -> 𝙋 + 0x51: 0x1d64c, # Q -> 𝙌 + 0x52: 0x1d64d, # R -> 𝙍 + 0x53: 0x1d64e, # S -> 𝙎 + 0x54: 0x1d64f, # T -> 𝙏 + 0x55: 0x1d650, # U -> 𝙐 + 0x56: 0x1d651, # V -> 𝙑 + 0x57: 0x1d652, # W -> 𝙒 + 0x58: 0x1d653, # X -> 𝙓 + 0x59: 0x1d654, # Y -> 𝙔 + 0x5a: 0x1d655, # Z -> 𝙕 + # latin lower case + 0x61: 0x1d656, # a -> 𝙖 + 0x62: 0x1d657, # b -> 𝙗 + 0x63: 0x1d658, # c -> 𝙘 + 0x64: 0x1d659, # d -> 𝙙 + 0x65: 0x1d65a, # e -> 𝙚 + 0x66: 0x1d65b, # f -> 𝙛 + 0x67: 0x1d65c, # g -> 𝙜 + 0x68: 0x1d65d, # h -> 𝙝 + 0x69: 0x1d65e, # i -> 𝙞 + 0x6a: 0x1d65f, # j -> 𝙟 + 0x6b: 0x1d660, # k -> 𝙠 + 0x6c: 0x1d661, # l -> 𝙡 + 0x6d: 0x1d662, # m -> 𝙢 + 0x6e: 0x1d663, # n -> 𝙣 + 0x6f: 0x1d664, # o -> 𝙤 + 0x70: 0x1d665, # p -> 𝙥 + 0x71: 0x1d666, # q -> 𝙦 + 0x72: 0x1d667, # r -> 𝙧 + 0x73: 0x1d668, # s -> 𝙨 + 0x74: 0x1d669, # t -> 𝙩 + 0x75: 0x1d66a, # u -> 𝙪 + 0x76: 0x1d66b, # v -> 𝙫 + 0x77: 0x1d66c, # w -> 𝙬 + 0x78: 0x1d66d, # x -> 𝙭 + 0x79: 0x1d66e, # y -> 𝙮 + 0x7a: 0x1d66f, # z -> 𝙯 + # greek upper case + 0x391: 0x1d790, # Α -> 𝞐 + 0x392: 0x1d791, # Β -> 𝞑 + 0x393: 0x1d792, # Γ -> 𝞒 + 0x394: 0x1d793, # Δ -> 𝞓 + 0x395: 0x1d794, # Ε -> 𝞔 + 0x396: 0x1d795, # Ζ -> 𝞕 + 0x397: 0x1d796, # Η -> 𝞖 + 0x398: 0x1d797, # Θ -> 𝞗 + 0x399: 0x1d798, # Ι -> 𝞘 + 0x39a: 0x1d799, # Κ -> 𝞙 + 0x39b: 0x1d79a, # Λ -> 𝞚 + 0x39c: 0x1d79b, # Μ -> 𝞛 + 0x39d: 0x1d79c, # Ν -> 𝞜 + 0x39e: 0x1d79d, # Ξ -> 𝞝 + 0x39f: 0x1d79e, # Ο -> 𝞞 + 0x3a0: 0x1d79f, # Π -> 𝞟 + 0x3a1: 0x1d7a0, # Ρ -> 𝞠 + 0x3f4: 0x1d7a1, # ϴ -> 𝞡 + 0x3a3: 0x1d7a2, # Σ -> 𝞢 + 0x3a4: 0x1d7a3, # Τ -> 𝞣 + 0x3a5: 0x1d7a4, # Υ -> 𝞤 + 0x3a6: 0x1d7a5, # Φ -> 𝞥 + 0x3a7: 0x1d7a6, # Χ -> 𝞦 + 0x3a8: 0x1d7a7, # Ψ -> 𝞧 + 0x3a9: 0x1d7a8, # Ω -> 𝞨 + # greek lower case + 0x3b1: 0x1d7aa, # α -> 𝞪 + 0x3b2: 0x1d7ab, # β -> 𝞫 + 0x3b3: 0x1d7ac, # γ -> 𝞬 + 0x3b4: 0x1d7ad, # δ -> 𝞭 + 0x3b5: 0x1d7ae, # ε -> 𝞮 + 0x3b6: 0x1d7af, # ζ -> 𝞯 + 0x3b7: 0x1d7b0, # η -> 𝞰 + 0x3b8: 0x1d7b1, # θ -> 𝞱 + 0x3b9: 0x1d7b2, # ι -> 𝞲 + 0x3ba: 0x1d7b3, # κ -> 𝞳 + 0x3bb: 0x1d7b4, # λ -> 𝞴 + 0x3bc: 0x1d7b5, # μ -> 𝞵 + 0x3bd: 0x1d7b6, # ν -> 𝞶 + 0x3be: 0x1d7b7, # ξ -> 𝞷 + 0x3bf: 0x1d7b8, # ο -> 𝞸 + 0x3c0: 0x1d7b9, # π -> 𝞹 + 0x3c1: 0x1d7ba, # ρ -> 𝞺 + 0x3c2: 0x1d7bb, # ς -> 𝞻 + 0x3c3: 0x1d7bc, # σ -> 𝞼 + 0x3c4: 0x1d7bd, # τ -> 𝞽 + 0x3c5: 0x1d7be, # υ -> 𝞾 + 0x3c6: 0x1d7bf, # φ -> 𝞿 + 0x3c7: 0x1d7c0, # χ -> 𝟀 + 0x3c8: 0x1d7c1, # ψ -> 𝟁 + 0x3c9: 0x1d7c2, # ω -> 𝟂 + 0x2202: 0x1d7c3, # ∂ -> 𝟃 + 0x3f5: 0x1d7c4, # ϵ -> 𝟄 + 0x3d1: 0x1d7c5, # ϑ -> 𝟅 + 0x3f0: 0x1d7c6, # ϰ -> 𝟆 + 0x3f1: 0x1d7c7, # ϱ -> 𝟇 + 0x3cf: 0x1d7c8, # Ϗ -> 𝟈 + 0x3d6: 0x1d7c9, # ϖ -> 𝟉 + }, + 'scr': { + # digits + # latin upper case + 0x41: 0x1d49c, # A -> 𝒜 + 0x42: 0x212c, # B -> ℬ + 0x43: 0x1d49e, # C -> 𝒞 + 0x44: 0x1d49f, # D -> 𝒟 + 0x45: 0x2130, # E -> ℰ + 0x46: 0x2131, # F -> ℱ + 0x47: 0x1d4a2, # G -> 𝒢 + 0x48: 0x210b, # H -> ℋ + 0x49: 0x2110, # I -> ℐ + 0x4a: 0x1d4a5, # J -> 𝒥 + 0x4b: 0x1d4a6, # K -> 𝒦 + 0x4c: 0x2112, # L -> ℒ + 0x4d: 0x2133, # M -> ℳ + 0x4e: 0x1d4a9, # N -> 𝒩 + 0x4f: 0x1d4aa, # O -> 𝒪 + 0x50: 0x1d4ab, # P -> 𝒫 + 0x51: 0x1d4ac, # Q -> 𝒬 + 0x52: 0x211b, # R -> ℛ + 0x53: 0x1d4ae, # S -> 𝒮 + 0x54: 0x1d4af, # T -> 𝒯 + 0x55: 0x1d4b0, # U -> 𝒰 + 0x56: 0x1d4b1, # V -> 𝒱 + 0x57: 0x1d4b2, # W -> 𝒲 + 0x58: 0x1d4b3, # X -> 𝒳 + 0x59: 0x1d4b4, # Y -> 𝒴 + 0x5a: 0x1d4b5, # Z -> 𝒵 + # latin lower case + 0x61: 0x1d4b6, # a -> 𝒶 + 0x62: 0x1d4b7, # b -> 𝒷 + 0x63: 0x1d4b8, # c -> 𝒸 + 0x64: 0x1d4b9, # d -> 𝒹 + 0x65: 0x212f, # e -> ℯ + 0x66: 0x1d4bb, # f -> 𝒻 + 0x67: 0x210a, # g -> ℊ + 0x68: 0x1d4bd, # h -> 𝒽 + 0x69: 0x1d4be, # i -> 𝒾 + 0x6a: 0x1d4bf, # j -> 𝒿 + 0x6b: 0x1d4c0, # k -> 𝓀 + 0x6c: 0x1d4c1, # l -> 𝓁 + 0x6d: 0x1d4c2, # m -> 𝓂 + 0x6e: 0x1d4c3, # n -> 𝓃 + 0x6f: 0x2134, # o -> ℴ + 0x70: 0x1d4c5, # p -> 𝓅 + 0x71: 0x1d4c6, # q -> 𝓆 + 0x72: 0x1d4c7, # r -> 𝓇 + 0x73: 0x1d4c8, # s -> 𝓈 + 0x74: 0x1d4c9, # t -> 𝓉 + 0x75: 0x1d4ca, # u -> 𝓊 + 0x76: 0x1d4cb, # v -> 𝓋 + 0x77: 0x1d4cc, # w -> 𝓌 + 0x78: 0x1d4cd, # x -> 𝓍 + 0x79: 0x1d4ce, # y -> 𝓎 + 0x7a: 0x1d4cf, # z -> 𝓏 + # greek upper case + # greek lower case + }, + 'bfscr': { + # digits + # latin upper case + 0x41: 0x1d4d0, # A -> 𝓐 + 0x42: 0x1d4d1, # B -> 𝓑 + 0x43: 0x1d4d2, # C -> 𝓒 + 0x44: 0x1d4d3, # D -> 𝓓 + 0x45: 0x1d4d4, # E -> 𝓔 + 0x46: 0x1d4d5, # F -> 𝓕 + 0x47: 0x1d4d6, # G -> 𝓖 + 0x48: 0x1d4d7, # H -> 𝓗 + 0x49: 0x1d4d8, # I -> 𝓘 + 0x4a: 0x1d4d9, # J -> 𝓙 + 0x4b: 0x1d4da, # K -> 𝓚 + 0x4c: 0x1d4db, # L -> 𝓛 + 0x4d: 0x1d4dc, # M -> 𝓜 + 0x4e: 0x1d4dd, # N -> 𝓝 + 0x4f: 0x1d4de, # O -> 𝓞 + 0x50: 0x1d4df, # P -> 𝓟 + 0x51: 0x1d4e0, # Q -> 𝓠 + 0x52: 0x1d4e1, # R -> 𝓡 + 0x53: 0x1d4e2, # S -> 𝓢 + 0x54: 0x1d4e3, # T -> 𝓣 + 0x55: 0x1d4e4, # U -> 𝓤 + 0x56: 0x1d4e5, # V -> 𝓥 + 0x57: 0x1d4e6, # W -> 𝓦 + 0x58: 0x1d4e7, # X -> 𝓧 + 0x59: 0x1d4e8, # Y -> 𝓨 + 0x5a: 0x1d4e9, # Z -> 𝓩 + # latin lower case + 0x61: 0x1d4ea, # a -> 𝓪 + 0x62: 0x1d4eb, # b -> 𝓫 + 0x63: 0x1d4ec, # c -> 𝓬 + 0x64: 0x1d4ed, # d -> 𝓭 + 0x65: 0x1d4ee, # e -> 𝓮 + 0x66: 0x1d4ef, # f -> 𝓯 + 0x67: 0x1d4f0, # g -> 𝓰 + 0x68: 0x1d4f1, # h -> 𝓱 + 0x69: 0x1d4f2, # i -> 𝓲 + 0x6a: 0x1d4f3, # j -> 𝓳 + 0x6b: 0x1d4f4, # k -> 𝓴 + 0x6c: 0x1d4f5, # l -> 𝓵 + 0x6d: 0x1d4f6, # m -> 𝓶 + 0x6e: 0x1d4f7, # n -> 𝓷 + 0x6f: 0x1d4f8, # o -> 𝓸 + 0x70: 0x1d4f9, # p -> 𝓹 + 0x71: 0x1d4fa, # q -> 𝓺 + 0x72: 0x1d4fb, # r -> 𝓻 + 0x73: 0x1d4fc, # s -> 𝓼 + 0x74: 0x1d4fd, # t -> 𝓽 + 0x75: 0x1d4fe, # u -> 𝓾 + 0x76: 0x1d4ff, # v -> 𝓿 + 0x77: 0x1d500, # w -> 𝔀 + 0x78: 0x1d501, # x -> 𝔁 + 0x79: 0x1d502, # y -> 𝔂 + 0x7a: 0x1d503, # z -> 𝔃 + # greek upper case + # greek lower case + }, + 'frak': { + # digits + # latin upper case + 0x41: 0x1d504, # A -> 𝔄 + 0x42: 0x1d505, # B -> 𝔅 + 0x43: 0x212d, # C -> ℭ + 0x44: 0x1d507, # D -> 𝔇 + 0x45: 0x1d508, # E -> 𝔈 + 0x46: 0x1d509, # F -> 𝔉 + 0x47: 0x1d50a, # G -> 𝔊 + 0x48: 0x210c, # H -> ℌ + 0x49: 0x2111, # I -> ℑ + 0x4a: 0x1d50d, # J -> 𝔍 + 0x4b: 0x1d50e, # K -> 𝔎 + 0x4c: 0x1d50f, # L -> 𝔏 + 0x4d: 0x1d510, # M -> 𝔐 + 0x4e: 0x1d511, # N -> 𝔑 + 0x4f: 0x1d512, # O -> 𝔒 + 0x50: 0x1d513, # P -> 𝔓 + 0x51: 0x1d514, # Q -> 𝔔 + 0x52: 0x211c, # R -> ℜ + 0x53: 0x1d516, # S -> 𝔖 + 0x54: 0x1d517, # T -> 𝔗 + 0x55: 0x1d518, # U -> 𝔘 + 0x56: 0x1d519, # V -> 𝔙 + 0x57: 0x1d51a, # W -> 𝔚 + 0x58: 0x1d51b, # X -> 𝔛 + 0x59: 0x1d51c, # Y -> 𝔜 + 0x5a: 0x2128, # Z -> ℨ + # latin lower case + 0x61: 0x1d51e, # a -> 𝔞 + 0x62: 0x1d51f, # b -> 𝔟 + 0x63: 0x1d520, # c -> 𝔠 + 0x64: 0x1d521, # d -> 𝔡 + 0x65: 0x1d522, # e -> 𝔢 + 0x66: 0x1d523, # f -> 𝔣 + 0x67: 0x1d524, # g -> 𝔤 + 0x68: 0x1d525, # h -> 𝔥 + 0x69: 0x1d526, # i -> 𝔦 + 0x6a: 0x1d527, # j -> 𝔧 + 0x6b: 0x1d528, # k -> 𝔨 + 0x6c: 0x1d529, # l -> 𝔩 + 0x6d: 0x1d52a, # m -> 𝔪 + 0x6e: 0x1d52b, # n -> 𝔫 + 0x6f: 0x1d52c, # o -> 𝔬 + 0x70: 0x1d52d, # p -> 𝔭 + 0x71: 0x1d52e, # q -> 𝔮 + 0x72: 0x1d52f, # r -> 𝔯 + 0x73: 0x1d530, # s -> 𝔰 + 0x74: 0x1d531, # t -> 𝔱 + 0x75: 0x1d532, # u -> 𝔲 + 0x76: 0x1d533, # v -> 𝔳 + 0x77: 0x1d534, # w -> 𝔴 + 0x78: 0x1d535, # x -> 𝔵 + 0x79: 0x1d536, # y -> 𝔶 + 0x7a: 0x1d537, # z -> 𝔷 + # greek upper case + # greek lower case + }, + 'bffrak': { + # digits + # latin upper case + 0x41: 0x1d56c, # A -> 𝕬 + 0x42: 0x1d56d, # B -> 𝕭 + 0x43: 0x1d56e, # C -> 𝕮 + 0x44: 0x1d56f, # D -> 𝕯 + 0x45: 0x1d570, # E -> 𝕰 + 0x46: 0x1d571, # F -> 𝕱 + 0x47: 0x1d572, # G -> 𝕲 + 0x48: 0x1d573, # H -> 𝕳 + 0x49: 0x1d574, # I -> 𝕴 + 0x4a: 0x1d575, # J -> 𝕵 + 0x4b: 0x1d576, # K -> 𝕶 + 0x4c: 0x1d577, # L -> 𝕷 + 0x4d: 0x1d578, # M -> 𝕸 + 0x4e: 0x1d579, # N -> 𝕹 + 0x4f: 0x1d57a, # O -> 𝕺 + 0x50: 0x1d57b, # P -> 𝕻 + 0x51: 0x1d57c, # Q -> 𝕼 + 0x52: 0x1d57d, # R -> 𝕽 + 0x53: 0x1d57e, # S -> 𝕾 + 0x54: 0x1d57f, # T -> 𝕿 + 0x55: 0x1d580, # U -> 𝖀 + 0x56: 0x1d581, # V -> 𝖁 + 0x57: 0x1d582, # W -> 𝖂 + 0x58: 0x1d583, # X -> 𝖃 + 0x59: 0x1d584, # Y -> 𝖄 + 0x5a: 0x1d585, # Z -> 𝖅 + # latin lower case + 0x61: 0x1d586, # a -> 𝖆 + 0x62: 0x1d587, # b -> 𝖇 + 0x63: 0x1d588, # c -> 𝖈 + 0x64: 0x1d589, # d -> 𝖉 + 0x65: 0x1d58a, # e -> 𝖊 + 0x66: 0x1d58b, # f -> 𝖋 + 0x67: 0x1d58c, # g -> 𝖌 + 0x68: 0x1d58d, # h -> 𝖍 + 0x69: 0x1d58e, # i -> 𝖎 + 0x6a: 0x1d58f, # j -> 𝖏 + 0x6b: 0x1d590, # k -> 𝖐 + 0x6c: 0x1d591, # l -> 𝖑 + 0x6d: 0x1d592, # m -> 𝖒 + 0x6e: 0x1d593, # n -> 𝖓 + 0x6f: 0x1d594, # o -> 𝖔 + 0x70: 0x1d595, # p -> 𝖕 + 0x71: 0x1d596, # q -> 𝖖 + 0x72: 0x1d597, # r -> 𝖗 + 0x73: 0x1d598, # s -> 𝖘 + 0x74: 0x1d599, # t -> 𝖙 + 0x75: 0x1d59a, # u -> 𝖚 + 0x76: 0x1d59b, # v -> 𝖛 + 0x77: 0x1d59c, # w -> 𝖜 + 0x78: 0x1d59d, # x -> 𝖝 + 0x79: 0x1d59e, # y -> 𝖞 + 0x7a: 0x1d59f, # z -> 𝖟 + # greek upper case + # greek lower case + }, + 'tt': { + # digits + 0x30: 0x1d7f6, # 0 -> 𝟶 + 0x31: 0x1d7f7, # 1 -> 𝟷 + 0x32: 0x1d7f8, # 2 -> 𝟸 + 0x33: 0x1d7f9, # 3 -> 𝟹 + 0x34: 0x1d7fa, # 4 -> 𝟺 + 0x35: 0x1d7fb, # 5 -> 𝟻 + 0x36: 0x1d7fc, # 6 -> 𝟼 + 0x37: 0x1d7fd, # 7 -> 𝟽 + 0x38: 0x1d7fe, # 8 -> 𝟾 + 0x39: 0x1d7ff, # 9 -> 𝟿 + # latin upper case + 0x41: 0x1d670, # A -> 𝙰 + 0x42: 0x1d671, # B -> 𝙱 + 0x43: 0x1d672, # C -> 𝙲 + 0x44: 0x1d673, # D -> 𝙳 + 0x45: 0x1d674, # E -> 𝙴 + 0x46: 0x1d675, # F -> 𝙵 + 0x47: 0x1d676, # G -> 𝙶 + 0x48: 0x1d677, # H -> 𝙷 + 0x49: 0x1d678, # I -> 𝙸 + 0x4a: 0x1d679, # J -> 𝙹 + 0x4b: 0x1d67a, # K -> 𝙺 + 0x4c: 0x1d67b, # L -> 𝙻 + 0x4d: 0x1d67c, # M -> 𝙼 + 0x4e: 0x1d67d, # N -> 𝙽 + 0x4f: 0x1d67e, # O -> 𝙾 + 0x50: 0x1d67f, # P -> 𝙿 + 0x51: 0x1d680, # Q -> 𝚀 + 0x52: 0x1d681, # R -> 𝚁 + 0x53: 0x1d682, # S -> 𝚂 + 0x54: 0x1d683, # T -> 𝚃 + 0x55: 0x1d684, # U -> 𝚄 + 0x56: 0x1d685, # V -> 𝚅 + 0x57: 0x1d686, # W -> 𝚆 + 0x58: 0x1d687, # X -> 𝚇 + 0x59: 0x1d688, # Y -> 𝚈 + 0x5a: 0x1d689, # Z -> 𝚉 + # latin lower case + 0x61: 0x1d68a, # a -> 𝚊 + 0x62: 0x1d68b, # b -> 𝚋 + 0x63: 0x1d68c, # c -> 𝚌 + 0x64: 0x1d68d, # d -> 𝚍 + 0x65: 0x1d68e, # e -> 𝚎 + 0x66: 0x1d68f, # f -> 𝚏 + 0x67: 0x1d690, # g -> 𝚐 + 0x68: 0x1d691, # h -> 𝚑 + 0x69: 0x1d692, # i -> 𝚒 + 0x6a: 0x1d693, # j -> 𝚓 + 0x6b: 0x1d694, # k -> 𝚔 + 0x6c: 0x1d695, # l -> 𝚕 + 0x6d: 0x1d696, # m -> 𝚖 + 0x6e: 0x1d697, # n -> 𝚗 + 0x6f: 0x1d698, # o -> 𝚘 + 0x70: 0x1d699, # p -> 𝚙 + 0x71: 0x1d69a, # q -> 𝚚 + 0x72: 0x1d69b, # r -> 𝚛 + 0x73: 0x1d69c, # s -> 𝚜 + 0x74: 0x1d69d, # t -> 𝚝 + 0x75: 0x1d69e, # u -> 𝚞 + 0x76: 0x1d69f, # v -> 𝚟 + 0x77: 0x1d6a0, # w -> 𝚠 + 0x78: 0x1d6a1, # x -> 𝚡 + 0x79: 0x1d6a2, # y -> 𝚢 + 0x7a: 0x1d6a3, # z -> 𝚣 + # greek upper case + # greek lower case + }, + 'bb': { + # digits + 0x30: 0x1d7d8, # 0 -> 𝟘 + 0x31: 0x1d7d9, # 1 -> 𝟙 + 0x32: 0x1d7da, # 2 -> 𝟚 + 0x33: 0x1d7db, # 3 -> 𝟛 + 0x34: 0x1d7dc, # 4 -> 𝟜 + 0x35: 0x1d7dd, # 5 -> 𝟝 + 0x36: 0x1d7de, # 6 -> 𝟞 + 0x37: 0x1d7df, # 7 -> 𝟟 + 0x38: 0x1d7e0, # 8 -> 𝟠 + 0x39: 0x1d7e1, # 9 -> 𝟡 + # latin upper case + 0x41: 0x1d538, # A -> 𝔸 + 0x42: 0x1d539, # B -> 𝔹 + 0x43: 0x2102, # C -> ℂ + 0x44: 0x1d53b, # D -> 𝔻 + 0x45: 0x1d53c, # E -> 𝔼 + 0x46: 0x1d53d, # F -> 𝔽 + 0x47: 0x1d53e, # G -> 𝔾 + 0x48: 0x210d, # H -> ℍ + 0x49: 0x1d540, # I -> 𝕀 + 0x4a: 0x1d541, # J -> 𝕁 + 0x4b: 0x1d542, # K -> 𝕂 + 0x4c: 0x1d543, # L -> 𝕃 + 0x4d: 0x1d544, # M -> 𝕄 + 0x4e: 0x2115, # N -> ℕ + 0x4f: 0x1d546, # O -> 𝕆 + 0x50: 0x2119, # P -> ℙ + 0x51: 0x211a, # Q -> ℚ + 0x52: 0x211d, # R -> ℝ + 0x53: 0x1d54a, # S -> 𝕊 + 0x54: 0x1d54b, # T -> 𝕋 + 0x55: 0x1d54c, # U -> 𝕌 + 0x56: 0x1d54d, # V -> 𝕍 + 0x57: 0x1d54e, # W -> 𝕎 + 0x58: 0x1d54f, # X -> 𝕏 + 0x59: 0x1d550, # Y -> 𝕐 + 0x5a: 0x2124, # Z -> ℤ + # latin lower case + 0x61: 0x1d552, # a -> 𝕒 + 0x62: 0x1d553, # b -> 𝕓 + 0x63: 0x1d554, # c -> 𝕔 + 0x64: 0x1d555, # d -> 𝕕 + 0x65: 0x1d556, # e -> 𝕖 + 0x66: 0x1d557, # f -> 𝕗 + 0x67: 0x1d558, # g -> 𝕘 + 0x68: 0x1d559, # h -> 𝕙 + 0x69: 0x1d55a, # i -> 𝕚 + 0x6a: 0x1d55b, # j -> 𝕛 + 0x6b: 0x1d55c, # k -> 𝕜 + 0x6c: 0x1d55d, # l -> 𝕝 + 0x6d: 0x1d55e, # m -> 𝕞 + 0x6e: 0x1d55f, # n -> 𝕟 + 0x6f: 0x1d560, # o -> 𝕠 + 0x70: 0x1d561, # p -> 𝕡 + 0x71: 0x1d562, # q -> 𝕢 + 0x72: 0x1d563, # r -> 𝕣 + 0x73: 0x1d564, # s -> 𝕤 + 0x74: 0x1d565, # t -> 𝕥 + 0x75: 0x1d566, # u -> 𝕦 + 0x76: 0x1d567, # v -> 𝕧 + 0x77: 0x1d568, # w -> 𝕨 + 0x78: 0x1d569, # x -> 𝕩 + 0x79: 0x1d56a, # y -> 𝕪 + 0x7a: 0x1d56b, # z -> 𝕫 + # greek upper case + # greek lower case + } +} + +greek_uppercase_domain = { + *range(0x0391, 0x0391+0x11), + ord('ϴ'), + *range(0x0391 + 0x12, 0x0391 + 0x19), + ord('∇'), +} +greek_lowercase_domain = {*range(0x03B1, 0x03B1+0x19)} | {ord(c) for c in "∂ϵϑϰϕϱϖ"} diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index a88c35c15676..c8beab25f6cb 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -43,6 +43,7 @@ class MathTextParser: 'stix': _mathtext.StixFonts, 'stixsans': _mathtext.StixSansFonts, 'custom': _mathtext.UnicodeFonts, + 'unicodemath': _mathtext.UnicodeMathFonts, } def __init__(self, output): diff --git a/lib/matplotlib/mpl-data/matplotlibrc b/lib/matplotlib/mpl-data/matplotlibrc index 4fd08aa60578..305e273d72ed 100644 --- a/lib/matplotlib/mpl-data/matplotlibrc +++ b/lib/matplotlib/mpl-data/matplotlibrc @@ -360,10 +360,12 @@ ## The following settings allow you to select the fonts in math mode. #mathtext.fontset: dejavusans # Should be 'dejavusans' (default), # 'dejavuserif', 'cm' (Computer Modern), 'stix', - # 'stixsans' or 'custom' + # 'stixsans', 'unicodemath', or 'custom' ## "mathtext.fontset: custom" is defined by the mathtext.bf, .cal, .it, ... ## settings which map a TeX font name to a fontconfig font pattern. (These ## settings are not used for other font sets.) +## "mathtext.fontset: unicodemath" is defined by the mathtext.mathfont setting, +## which accepts a OpenType mathematics font name (for example 'STIX Two Math'). #mathtext.bf: sans:bold #mathtext.bfit: sans:italic:bold #mathtext.cal: cursive @@ -371,6 +373,7 @@ #mathtext.rm: sans #mathtext.sf: sans #mathtext.tt: monospace +#mathtext.mathfont: STIX Two Math #mathtext.fallback: cm # Select fallback font from ['cm' (Computer Modern), 'stix' # 'stixsans'] when a symbol cannot be found in one of the # custom math fonts. Select 'None' to not perform fallback diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index f70697fdab45..6b5cc8039a79 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -1090,8 +1090,9 @@ def _convert_validator_spec(key, conv): "mathtext.bf": validate_font_properties, "mathtext.bfit": validate_font_properties, "mathtext.sf": validate_font_properties, + "mathtext.mathfont": validate_font_properties, "mathtext.fontset": ["dejavusans", "dejavuserif", "cm", "stix", - "stixsans", "custom"], + "stixsans", "unicodemath", "custom"], "mathtext.default": ["rm", "cal", "bfit", "it", "tt", "sf", "bf", "default", "bb", "frak", "scr", "regular"], "mathtext.fallback": _validate_mathtext_fallback, @@ -1866,9 +1867,11 @@ class _Param: _Param( "mathtext.fontset", default="dejavusans", - validator=["dejavusans", "dejavuserif", "cm", "stix", "stixsans", "custom"], + validator=["dejavusans", "dejavuserif", "cm", "stix", "stixsans", "unicodemath", + "custom"], description="Should be 'dejavusans' (default), 'dejavuserif', " - "'cm' (Computer Modern), 'stix', 'stixsans' or 'custom'" + "'cm' (Computer Modern), 'stix', 'stixsans', 'unicodemath' " + "or 'custom'" ), _Param("mathtext.bf", "sans:bold", validate_font_properties), _Param("mathtext.bfit", "sans:italic:bold", validate_font_properties), @@ -1877,6 +1880,7 @@ class _Param: _Param("mathtext.rm", "sans", validate_font_properties), _Param("mathtext.sf", "sans", validate_font_properties), _Param("mathtext.tt", "monospace", validate_font_properties), + _Param("mathtext.mathfont", "STIX Two Math", validate_font_properties), _Param( "mathtext.fallback", default="cm", diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_00.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_00.png new file mode 100644 index 000000000000..4e035d41d8fd Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_00.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_01.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_01.png new file mode 100644 index 000000000000..3ba8a7b6f193 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_01.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_02.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_02.png new file mode 100644 index 000000000000..ad95b7958bb8 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_02.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_03.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_03.png new file mode 100644 index 000000000000..2f48b0404cbe Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_03.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_04.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_04.png new file mode 100644 index 000000000000..318809f28d56 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_04.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_05.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_05.png new file mode 100644 index 000000000000..7b6849f612c3 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_05.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_06.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_06.png new file mode 100644 index 000000000000..d7ffa0142605 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_06.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_07.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_07.png new file mode 100644 index 000000000000..dc638fa53cea Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_07.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_08.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_08.png new file mode 100644 index 000000000000..f8df09627055 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_08.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_09.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_09.png new file mode 100644 index 000000000000..d7a4fceb0743 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_09.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_10.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_10.png new file mode 100644 index 000000000000..689b92e45ff8 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_10.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_11.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_11.png new file mode 100644 index 000000000000..3c3785d8a9c5 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_11.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_12.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_12.png new file mode 100644 index 000000000000..0b1a5aea130e Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_12.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_13.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_13.png new file mode 100644 index 000000000000..badc2c03da09 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_13.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_14.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_14.png new file mode 100644 index 000000000000..40dafd0f4382 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_14.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_15.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_15.png new file mode 100644 index 000000000000..2391c0df0058 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_15.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_16.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_16.png new file mode 100644 index 000000000000..2dd88e7924d2 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_16.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_17.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_17.png new file mode 100644 index 000000000000..56f1136bb66b Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_17.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_18.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_18.png new file mode 100644 index 000000000000..f0bbf74151b1 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_18.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_19.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_19.png new file mode 100644 index 000000000000..4f382cf2190e Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_19.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_20.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_20.png new file mode 100644 index 000000000000..cfc9d5889b67 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_20.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_21.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_21.png new file mode 100644 index 000000000000..2359c563d86e Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_21.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_22.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_22.png new file mode 100644 index 000000000000..7ded85de4ba0 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_22.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_32.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_32.png new file mode 100644 index 000000000000..b1dfb9bac789 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_32.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_33.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_33.png new file mode 100644 index 000000000000..6b46e084e1e7 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_33.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_34.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_34.png new file mode 100644 index 000000000000..0813ed8c43bd Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_34.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_35.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_35.png new file mode 100644 index 000000000000..8b2d510496de Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_35.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_36.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_36.png new file mode 100644 index 000000000000..88d8e2f03280 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_36.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_37.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_37.png new file mode 100644 index 000000000000..2f393cee104f Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_37.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_38.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_38.png new file mode 100644 index 000000000000..195012ed7ea5 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_38.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_39.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_39.png new file mode 100644 index 000000000000..9a7208430fe3 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_39.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_40.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_40.png new file mode 100644 index 000000000000..a5992c14c74c Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_40.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_41.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_41.png new file mode 100644 index 000000000000..6d7055e3e4a7 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_41.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_42.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_42.png new file mode 100644 index 000000000000..a257caa3be54 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_42.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_43.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_43.png new file mode 100644 index 000000000000..155048ad512f Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_43.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_44.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_44.png new file mode 100644 index 000000000000..e89400a84aad Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_44.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_45.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_45.png new file mode 100644 index 000000000000..58466833b834 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_45.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_46.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_46.png new file mode 100644 index 000000000000..d5770eac3324 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_46.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_47.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_47.png new file mode 100644 index 000000000000..2c42feea5a67 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_47.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_48.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_48.png new file mode 100644 index 000000000000..4d5911cc0516 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_48.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_49.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_49.png new file mode 100644 index 000000000000..700ea284f80c Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_49.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_50.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_50.png new file mode 100644 index 000000000000..c4d78642bef5 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_50.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_51.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_51.png new file mode 100644 index 000000000000..7d184eef1eb6 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_51.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_52.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_52.png new file mode 100644 index 000000000000..b37a659e1a22 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_52.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_53.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_53.png new file mode 100644 index 000000000000..24210ae1ff1a Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_53.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_54.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_54.png new file mode 100644 index 000000000000..4ccd95f2837b Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_54.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_55.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_55.png new file mode 100644 index 000000000000..cfd8ca238eab Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_55.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_56.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_56.png new file mode 100644 index 000000000000..86372e28dafa Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_56.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_57.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_57.png new file mode 100644 index 000000000000..1eeaa3b8b5cc Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_57.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_58.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_58.png new file mode 100644 index 000000000000..10bf9080e0f6 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_58.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_59.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_59.png new file mode 100644 index 000000000000..11c46358ffa6 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_59.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_60.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_60.png new file mode 100644 index 000000000000..101ea54d9365 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_60.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_61.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_61.png new file mode 100644 index 000000000000..b4f37fc5d7d9 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_61.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_62.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_62.png new file mode 100644 index 000000000000..40cfc1948b8c Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_62.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_63.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_63.png new file mode 100644 index 000000000000..b172e000fbaf Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_63.png differ diff --git a/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_64.png b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_64.png new file mode 100644 index 000000000000..19c83112d6c3 Binary files /dev/null and b/lib/matplotlib/tests/baseline_images/test_mathtext/mathfont_unicodemath_64.png differ diff --git a/lib/matplotlib/tests/data/LICENSE_STIX2 b/lib/matplotlib/tests/data/LICENSE_STIX2 new file mode 100644 index 000000000000..331f58a98c11 --- /dev/null +++ b/lib/matplotlib/tests/data/LICENSE_STIX2 @@ -0,0 +1,92 @@ +Copyright 2000-2021 The STIX Fonts Project Authors (https://github.com/stipub/stixfonts), with Reserved Font Name "TM Math". STIX Fonts™ is a trademark of The Institute of Electrical and Electronics Engineers, Inc. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/lib/matplotlib/tests/data/STIXTwoMath-Regular.otf b/lib/matplotlib/tests/data/STIXTwoMath-Regular.otf new file mode 100644 index 000000000000..29aa3b941578 Binary files /dev/null and b/lib/matplotlib/tests/data/STIXTwoMath-Regular.otf differ diff --git a/lib/matplotlib/tests/test_mathtext.py b/lib/matplotlib/tests/test_mathtext.py index ff3e4a4c0e60..de4a34f91f95 100644 --- a/lib/matplotlib/tests/test_mathtext.py +++ b/lib/matplotlib/tests/test_mathtext.py @@ -264,12 +264,14 @@ def test_mathtext_rendering_lightweight(baseline_images, fontset, index, text): @pytest.mark.parametrize( 'index, text', enumerate(font_tests), ids=range(len(font_tests))) @pytest.mark.parametrize( - 'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif']) + 'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif', 'unicodemath']) @pytest.mark.parametrize('baseline_images', ['mathfont'], indirect=True) @image_comparison(baseline_images=None, extensions=['png'], tol=0.011 if platform.machine() in ('ppc64le', 's390x') else 0) def test_mathfont_rendering(baseline_images, fontset, index, text): mpl.rcParams['mathtext.fontset'] = fontset + mpl.font_manager.fontManager.addfont( + (Path(__file__).resolve().parent / 'data/STIXTwoMath-Regular.otf')) fig = plt.figure(figsize=(5.25, 0.75)) fig.text(0.5, 0.5, text, horizontalalignment='center', verticalalignment='center') diff --git a/lib/matplotlib/typing.py b/lib/matplotlib/typing.py index 3c94c26c64ee..92cd15dff2fa 100644 --- a/lib/matplotlib/typing.py +++ b/lib/matplotlib/typing.py @@ -402,6 +402,7 @@ "mathtext.default", "mathtext.fallback", "mathtext.fontset", + "mathtext.mathfont", "mathtext.it", "mathtext.rm", "mathtext.sf",