_mathtext_data.py 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311
  1. """
  2. font data tables for truetype and afm computer modern fonts
  3. """
  4. from __future__ import annotations
  5. latex_to_bakoma = {
  6. '\\__sqrt__' : ('cmex10', 0x70),
  7. '\\bigcap' : ('cmex10', 0x5c),
  8. '\\bigcup' : ('cmex10', 0x5b),
  9. '\\bigodot' : ('cmex10', 0x4b),
  10. '\\bigoplus' : ('cmex10', 0x4d),
  11. '\\bigotimes' : ('cmex10', 0x4f),
  12. '\\biguplus' : ('cmex10', 0x5d),
  13. '\\bigvee' : ('cmex10', 0x5f),
  14. '\\bigwedge' : ('cmex10', 0x5e),
  15. '\\coprod' : ('cmex10', 0x61),
  16. '\\int' : ('cmex10', 0x5a),
  17. '\\langle' : ('cmex10', 0xad),
  18. '\\leftangle' : ('cmex10', 0xad),
  19. '\\leftbrace' : ('cmex10', 0xa9),
  20. '\\oint' : ('cmex10', 0x49),
  21. '\\prod' : ('cmex10', 0x59),
  22. '\\rangle' : ('cmex10', 0xae),
  23. '\\rightangle' : ('cmex10', 0xae),
  24. '\\rightbrace' : ('cmex10', 0xaa),
  25. '\\sum' : ('cmex10', 0x58),
  26. '\\widehat' : ('cmex10', 0x62),
  27. '\\widetilde' : ('cmex10', 0x65),
  28. '\\{' : ('cmex10', 0xa9),
  29. '\\}' : ('cmex10', 0xaa),
  30. '{' : ('cmex10', 0xa9),
  31. '}' : ('cmex10', 0xaa),
  32. ',' : ('cmmi10', 0x3b),
  33. '.' : ('cmmi10', 0x3a),
  34. '/' : ('cmmi10', 0x3d),
  35. '<' : ('cmmi10', 0x3c),
  36. '>' : ('cmmi10', 0x3e),
  37. '\\alpha' : ('cmmi10', 0xae),
  38. '\\beta' : ('cmmi10', 0xaf),
  39. '\\chi' : ('cmmi10', 0xc2),
  40. '\\combiningrightarrowabove' : ('cmmi10', 0x7e),
  41. '\\delta' : ('cmmi10', 0xb1),
  42. '\\ell' : ('cmmi10', 0x60),
  43. '\\epsilon' : ('cmmi10', 0xb2),
  44. '\\eta' : ('cmmi10', 0xb4),
  45. '\\flat' : ('cmmi10', 0x5b),
  46. '\\frown' : ('cmmi10', 0x5f),
  47. '\\gamma' : ('cmmi10', 0xb0),
  48. '\\imath' : ('cmmi10', 0x7b),
  49. '\\iota' : ('cmmi10', 0xb6),
  50. '\\jmath' : ('cmmi10', 0x7c),
  51. '\\kappa' : ('cmmi10', 0x2219),
  52. '\\lambda' : ('cmmi10', 0xb8),
  53. '\\leftharpoondown' : ('cmmi10', 0x29),
  54. '\\leftharpoonup' : ('cmmi10', 0x28),
  55. '\\mu' : ('cmmi10', 0xb9),
  56. '\\natural' : ('cmmi10', 0x5c),
  57. '\\nu' : ('cmmi10', 0xba),
  58. '\\omega' : ('cmmi10', 0x21),
  59. '\\phi' : ('cmmi10', 0xc1),
  60. '\\pi' : ('cmmi10', 0xbc),
  61. '\\psi' : ('cmmi10', 0xc3),
  62. '\\rho' : ('cmmi10', 0xbd),
  63. '\\rightharpoondown' : ('cmmi10', 0x2b),
  64. '\\rightharpoonup' : ('cmmi10', 0x2a),
  65. '\\sharp' : ('cmmi10', 0x5d),
  66. '\\sigma' : ('cmmi10', 0xbe),
  67. '\\smile' : ('cmmi10', 0x5e),
  68. '\\tau' : ('cmmi10', 0xbf),
  69. '\\theta' : ('cmmi10', 0xb5),
  70. '\\triangleleft' : ('cmmi10', 0x2f),
  71. '\\triangleright' : ('cmmi10', 0x2e),
  72. '\\upsilon' : ('cmmi10', 0xc0),
  73. '\\varepsilon' : ('cmmi10', 0x22),
  74. '\\varphi' : ('cmmi10', 0x27),
  75. '\\varrho' : ('cmmi10', 0x25),
  76. '\\varsigma' : ('cmmi10', 0x26),
  77. '\\vartheta' : ('cmmi10', 0x23),
  78. '\\wp' : ('cmmi10', 0x7d),
  79. '\\xi' : ('cmmi10', 0xbb),
  80. '\\zeta' : ('cmmi10', 0xb3),
  81. '!' : ('cmr10', 0x21),
  82. '%' : ('cmr10', 0x25),
  83. '&' : ('cmr10', 0x26),
  84. '(' : ('cmr10', 0x28),
  85. ')' : ('cmr10', 0x29),
  86. '+' : ('cmr10', 0x2b),
  87. '0' : ('cmr10', 0x30),
  88. '1' : ('cmr10', 0x31),
  89. '2' : ('cmr10', 0x32),
  90. '3' : ('cmr10', 0x33),
  91. '4' : ('cmr10', 0x34),
  92. '5' : ('cmr10', 0x35),
  93. '6' : ('cmr10', 0x36),
  94. '7' : ('cmr10', 0x37),
  95. '8' : ('cmr10', 0x38),
  96. '9' : ('cmr10', 0x39),
  97. ':' : ('cmr10', 0x3a),
  98. ';' : ('cmr10', 0x3b),
  99. '=' : ('cmr10', 0x3d),
  100. '?' : ('cmr10', 0x3f),
  101. '@' : ('cmr10', 0x40),
  102. '[' : ('cmr10', 0x5b),
  103. '\\#' : ('cmr10', 0x23),
  104. '\\$' : ('cmr10', 0x24),
  105. '\\%' : ('cmr10', 0x25),
  106. '\\Delta' : ('cmr10', 0xa2),
  107. '\\Gamma' : ('cmr10', 0xa1),
  108. '\\Lambda' : ('cmr10', 0xa4),
  109. '\\Omega' : ('cmr10', 0xad),
  110. '\\Phi' : ('cmr10', 0xa9),
  111. '\\Pi' : ('cmr10', 0xa6),
  112. '\\Psi' : ('cmr10', 0xaa),
  113. '\\Sigma' : ('cmr10', 0xa7),
  114. '\\Theta' : ('cmr10', 0xa3),
  115. '\\Upsilon' : ('cmr10', 0xa8),
  116. '\\Xi' : ('cmr10', 0xa5),
  117. '\\circumflexaccent' : ('cmr10', 0x5e),
  118. '\\combiningacuteaccent' : ('cmr10', 0xb6),
  119. '\\combiningbreve' : ('cmr10', 0xb8),
  120. '\\combiningdiaeresis' : ('cmr10', 0xc4),
  121. '\\combiningdotabove' : ('cmr10', 0x5f),
  122. '\\combininggraveaccent' : ('cmr10', 0xb5),
  123. '\\combiningoverline' : ('cmr10', 0xb9),
  124. '\\combiningtilde' : ('cmr10', 0x7e),
  125. '\\leftbracket' : ('cmr10', 0x5b),
  126. '\\leftparen' : ('cmr10', 0x28),
  127. '\\rightbracket' : ('cmr10', 0x5d),
  128. '\\rightparen' : ('cmr10', 0x29),
  129. '\\widebar' : ('cmr10', 0xb9),
  130. ']' : ('cmr10', 0x5d),
  131. '*' : ('cmsy10', 0xa4),
  132. '\N{MINUS SIGN}' : ('cmsy10', 0xa1),
  133. '\\Downarrow' : ('cmsy10', 0x2b),
  134. '\\Im' : ('cmsy10', 0x3d),
  135. '\\Leftarrow' : ('cmsy10', 0x28),
  136. '\\Leftrightarrow' : ('cmsy10', 0x2c),
  137. '\\P' : ('cmsy10', 0x7b),
  138. '\\Re' : ('cmsy10', 0x3c),
  139. '\\Rightarrow' : ('cmsy10', 0x29),
  140. '\\S' : ('cmsy10', 0x78),
  141. '\\Uparrow' : ('cmsy10', 0x2a),
  142. '\\Updownarrow' : ('cmsy10', 0x6d),
  143. '\\Vert' : ('cmsy10', 0x6b),
  144. '\\aleph' : ('cmsy10', 0x40),
  145. '\\approx' : ('cmsy10', 0xbc),
  146. '\\ast' : ('cmsy10', 0xa4),
  147. '\\asymp' : ('cmsy10', 0xb3),
  148. '\\backslash' : ('cmsy10', 0x6e),
  149. '\\bigcirc' : ('cmsy10', 0xb0),
  150. '\\bigtriangledown' : ('cmsy10', 0x35),
  151. '\\bigtriangleup' : ('cmsy10', 0x34),
  152. '\\bot' : ('cmsy10', 0x3f),
  153. '\\bullet' : ('cmsy10', 0xb2),
  154. '\\cap' : ('cmsy10', 0x5c),
  155. '\\cdot' : ('cmsy10', 0xa2),
  156. '\\circ' : ('cmsy10', 0xb1),
  157. '\\clubsuit' : ('cmsy10', 0x7c),
  158. '\\cup' : ('cmsy10', 0x5b),
  159. '\\dag' : ('cmsy10', 0x79),
  160. '\\dashv' : ('cmsy10', 0x61),
  161. '\\ddag' : ('cmsy10', 0x7a),
  162. '\\diamond' : ('cmsy10', 0xa6),
  163. '\\diamondsuit' : ('cmsy10', 0x7d),
  164. '\\div' : ('cmsy10', 0xa5),
  165. '\\downarrow' : ('cmsy10', 0x23),
  166. '\\emptyset' : ('cmsy10', 0x3b),
  167. '\\equiv' : ('cmsy10', 0xb4),
  168. '\\exists' : ('cmsy10', 0x39),
  169. '\\forall' : ('cmsy10', 0x38),
  170. '\\geq' : ('cmsy10', 0xb8),
  171. '\\gg' : ('cmsy10', 0xc0),
  172. '\\heartsuit' : ('cmsy10', 0x7e),
  173. '\\in' : ('cmsy10', 0x32),
  174. '\\infty' : ('cmsy10', 0x31),
  175. '\\lbrace' : ('cmsy10', 0x66),
  176. '\\lceil' : ('cmsy10', 0x64),
  177. '\\leftarrow' : ('cmsy10', 0xc3),
  178. '\\leftrightarrow' : ('cmsy10', 0x24),
  179. '\\leq' : ('cmsy10', 0x2219),
  180. '\\lfloor' : ('cmsy10', 0x62),
  181. '\\ll' : ('cmsy10', 0xbf),
  182. '\\mid' : ('cmsy10', 0x6a),
  183. '\\mp' : ('cmsy10', 0xa8),
  184. '\\nabla' : ('cmsy10', 0x72),
  185. '\\nearrow' : ('cmsy10', 0x25),
  186. '\\neg' : ('cmsy10', 0x3a),
  187. '\\ni' : ('cmsy10', 0x33),
  188. '\\nwarrow' : ('cmsy10', 0x2d),
  189. '\\odot' : ('cmsy10', 0xaf),
  190. '\\ominus' : ('cmsy10', 0xaa),
  191. '\\oplus' : ('cmsy10', 0xa9),
  192. '\\oslash' : ('cmsy10', 0xae),
  193. '\\otimes' : ('cmsy10', 0xad),
  194. '\\pm' : ('cmsy10', 0xa7),
  195. '\\prec' : ('cmsy10', 0xc1),
  196. '\\preceq' : ('cmsy10', 0xb9),
  197. '\\prime' : ('cmsy10', 0x30),
  198. '\\propto' : ('cmsy10', 0x2f),
  199. '\\rbrace' : ('cmsy10', 0x67),
  200. '\\rceil' : ('cmsy10', 0x65),
  201. '\\rfloor' : ('cmsy10', 0x63),
  202. '\\rightarrow' : ('cmsy10', 0x21),
  203. '\\searrow' : ('cmsy10', 0x26),
  204. '\\sim' : ('cmsy10', 0xbb),
  205. '\\simeq' : ('cmsy10', 0x27),
  206. '\\slash' : ('cmsy10', 0x36),
  207. '\\spadesuit' : ('cmsy10', 0xc4),
  208. '\\sqcap' : ('cmsy10', 0x75),
  209. '\\sqcup' : ('cmsy10', 0x74),
  210. '\\sqsubseteq' : ('cmsy10', 0x76),
  211. '\\sqsupseteq' : ('cmsy10', 0x77),
  212. '\\subset' : ('cmsy10', 0xbd),
  213. '\\subseteq' : ('cmsy10', 0xb5),
  214. '\\succ' : ('cmsy10', 0xc2),
  215. '\\succeq' : ('cmsy10', 0xba),
  216. '\\supset' : ('cmsy10', 0xbe),
  217. '\\supseteq' : ('cmsy10', 0xb6),
  218. '\\swarrow' : ('cmsy10', 0x2e),
  219. '\\times' : ('cmsy10', 0xa3),
  220. '\\to' : ('cmsy10', 0x21),
  221. '\\top' : ('cmsy10', 0x3e),
  222. '\\uparrow' : ('cmsy10', 0x22),
  223. '\\updownarrow' : ('cmsy10', 0x6c),
  224. '\\uplus' : ('cmsy10', 0x5d),
  225. '\\vdash' : ('cmsy10', 0x60),
  226. '\\vee' : ('cmsy10', 0x5f),
  227. '\\vert' : ('cmsy10', 0x6a),
  228. '\\wedge' : ('cmsy10', 0x5e),
  229. '\\wr' : ('cmsy10', 0x6f),
  230. '\\|' : ('cmsy10', 0x6b),
  231. '|' : ('cmsy10', 0x6a),
  232. '\\_' : ('cmtt10', 0x5f)
  233. }
  234. # Automatically generated.
  235. type12uni = {
  236. 'aring' : 229,
  237. 'quotedblright' : 8221,
  238. 'V' : 86,
  239. 'dollar' : 36,
  240. 'four' : 52,
  241. 'Yacute' : 221,
  242. 'P' : 80,
  243. 'underscore' : 95,
  244. 'p' : 112,
  245. 'Otilde' : 213,
  246. 'perthousand' : 8240,
  247. 'zero' : 48,
  248. 'dotlessi' : 305,
  249. 'Scaron' : 352,
  250. 'zcaron' : 382,
  251. 'egrave' : 232,
  252. 'section' : 167,
  253. 'Icircumflex' : 206,
  254. 'ntilde' : 241,
  255. 'ampersand' : 38,
  256. 'dotaccent' : 729,
  257. 'degree' : 176,
  258. 'K' : 75,
  259. 'acircumflex' : 226,
  260. 'Aring' : 197,
  261. 'k' : 107,
  262. 'smalltilde' : 732,
  263. 'Agrave' : 192,
  264. 'divide' : 247,
  265. 'ocircumflex' : 244,
  266. 'asciitilde' : 126,
  267. 'two' : 50,
  268. 'E' : 69,
  269. 'scaron' : 353,
  270. 'F' : 70,
  271. 'bracketleft' : 91,
  272. 'asciicircum' : 94,
  273. 'f' : 102,
  274. 'ordmasculine' : 186,
  275. 'mu' : 181,
  276. 'paragraph' : 182,
  277. 'nine' : 57,
  278. 'v' : 118,
  279. 'guilsinglleft' : 8249,
  280. 'backslash' : 92,
  281. 'six' : 54,
  282. 'A' : 65,
  283. 'icircumflex' : 238,
  284. 'a' : 97,
  285. 'ogonek' : 731,
  286. 'q' : 113,
  287. 'oacute' : 243,
  288. 'ograve' : 242,
  289. 'edieresis' : 235,
  290. 'comma' : 44,
  291. 'otilde' : 245,
  292. 'guillemotright' : 187,
  293. 'ecircumflex' : 234,
  294. 'greater' : 62,
  295. 'uacute' : 250,
  296. 'L' : 76,
  297. 'bullet' : 8226,
  298. 'cedilla' : 184,
  299. 'ydieresis' : 255,
  300. 'l' : 108,
  301. 'logicalnot' : 172,
  302. 'exclamdown' : 161,
  303. 'endash' : 8211,
  304. 'agrave' : 224,
  305. 'Adieresis' : 196,
  306. 'germandbls' : 223,
  307. 'Odieresis' : 214,
  308. 'space' : 32,
  309. 'quoteright' : 8217,
  310. 'ucircumflex' : 251,
  311. 'G' : 71,
  312. 'quoteleft' : 8216,
  313. 'W' : 87,
  314. 'Q' : 81,
  315. 'g' : 103,
  316. 'w' : 119,
  317. 'question' : 63,
  318. 'one' : 49,
  319. 'ring' : 730,
  320. 'figuredash' : 8210,
  321. 'B' : 66,
  322. 'iacute' : 237,
  323. 'Ydieresis' : 376,
  324. 'R' : 82,
  325. 'b' : 98,
  326. 'r' : 114,
  327. 'Ccedilla' : 199,
  328. 'minus' : 8722,
  329. 'Lslash' : 321,
  330. 'Uacute' : 218,
  331. 'yacute' : 253,
  332. 'Ucircumflex' : 219,
  333. 'quotedbl' : 34,
  334. 'onehalf' : 189,
  335. 'Thorn' : 222,
  336. 'M' : 77,
  337. 'eight' : 56,
  338. 'multiply' : 215,
  339. 'grave' : 96,
  340. 'Ocircumflex' : 212,
  341. 'm' : 109,
  342. 'Ugrave' : 217,
  343. 'guilsinglright' : 8250,
  344. 'Ntilde' : 209,
  345. 'questiondown' : 191,
  346. 'Atilde' : 195,
  347. 'ccedilla' : 231,
  348. 'Z' : 90,
  349. 'copyright' : 169,
  350. 'yen' : 165,
  351. 'Eacute' : 201,
  352. 'H' : 72,
  353. 'X' : 88,
  354. 'Idieresis' : 207,
  355. 'bar' : 124,
  356. 'h' : 104,
  357. 'x' : 120,
  358. 'udieresis' : 252,
  359. 'ordfeminine' : 170,
  360. 'braceleft' : 123,
  361. 'macron' : 175,
  362. 'atilde' : 227,
  363. 'Acircumflex' : 194,
  364. 'Oslash' : 216,
  365. 'C' : 67,
  366. 'quotedblleft' : 8220,
  367. 'S' : 83,
  368. 'exclam' : 33,
  369. 'Zcaron' : 381,
  370. 'equal' : 61,
  371. 's' : 115,
  372. 'eth' : 240,
  373. 'Egrave' : 200,
  374. 'hyphen' : 45,
  375. 'period' : 46,
  376. 'igrave' : 236,
  377. 'colon' : 58,
  378. 'Ecircumflex' : 202,
  379. 'trademark' : 8482,
  380. 'Aacute' : 193,
  381. 'cent' : 162,
  382. 'lslash' : 322,
  383. 'c' : 99,
  384. 'N' : 78,
  385. 'breve' : 728,
  386. 'Oacute' : 211,
  387. 'guillemotleft' : 171,
  388. 'n' : 110,
  389. 'idieresis' : 239,
  390. 'braceright' : 125,
  391. 'seven' : 55,
  392. 'brokenbar' : 166,
  393. 'ugrave' : 249,
  394. 'periodcentered' : 183,
  395. 'sterling' : 163,
  396. 'I' : 73,
  397. 'Y' : 89,
  398. 'Eth' : 208,
  399. 'emdash' : 8212,
  400. 'i' : 105,
  401. 'daggerdbl' : 8225,
  402. 'y' : 121,
  403. 'plusminus' : 177,
  404. 'less' : 60,
  405. 'Udieresis' : 220,
  406. 'D' : 68,
  407. 'five' : 53,
  408. 'T' : 84,
  409. 'oslash' : 248,
  410. 'acute' : 180,
  411. 'd' : 100,
  412. 'OE' : 338,
  413. 'Igrave' : 204,
  414. 't' : 116,
  415. 'parenright' : 41,
  416. 'adieresis' : 228,
  417. 'quotesingle' : 39,
  418. 'twodotenleader' : 8229,
  419. 'slash' : 47,
  420. 'ellipsis' : 8230,
  421. 'numbersign' : 35,
  422. 'odieresis' : 246,
  423. 'O' : 79,
  424. 'oe' : 339,
  425. 'o' : 111,
  426. 'Edieresis' : 203,
  427. 'plus' : 43,
  428. 'dagger' : 8224,
  429. 'three' : 51,
  430. 'hungarumlaut' : 733,
  431. 'parenleft' : 40,
  432. 'fraction' : 8260,
  433. 'registered' : 174,
  434. 'J' : 74,
  435. 'dieresis' : 168,
  436. 'Ograve' : 210,
  437. 'j' : 106,
  438. 'z' : 122,
  439. 'ae' : 230,
  440. 'semicolon' : 59,
  441. 'at' : 64,
  442. 'Iacute' : 205,
  443. 'percent' : 37,
  444. 'bracketright' : 93,
  445. 'AE' : 198,
  446. 'asterisk' : 42,
  447. 'aacute' : 225,
  448. 'U' : 85,
  449. 'eacute' : 233,
  450. 'e' : 101,
  451. 'thorn' : 254,
  452. 'u' : 117,
  453. }
  454. uni2type1 = {v: k for k, v in type12uni.items()}
  455. # The script below is to sort and format the tex2uni dict
  456. ## For decimal values: int(hex(v), 16)
  457. # newtex = {k: hex(v) for k, v in tex2uni.items()}
  458. # sd = dict(sorted(newtex.items(), key=lambda item: item[0]))
  459. #
  460. ## For formatting the sorted dictionary with proper spacing
  461. ## the value '24' comes from finding the longest string in
  462. ## the newtex keys with len(max(newtex, key=len))
  463. # for key in sd:
  464. # print("{0:24} : {1: <s},".format("'" + key + "'", sd[key]))
  465. tex2uni = {
  466. '#' : 0x23,
  467. '$' : 0x24,
  468. '%' : 0x25,
  469. 'AA' : 0xc5,
  470. 'AE' : 0xc6,
  471. 'BbbC' : 0x2102,
  472. 'BbbN' : 0x2115,
  473. 'BbbP' : 0x2119,
  474. 'BbbQ' : 0x211a,
  475. 'BbbR' : 0x211d,
  476. 'BbbZ' : 0x2124,
  477. 'Bumpeq' : 0x224e,
  478. 'Cap' : 0x22d2,
  479. 'Colon' : 0x2237,
  480. 'Cup' : 0x22d3,
  481. 'DH' : 0xd0,
  482. 'Delta' : 0x394,
  483. 'Doteq' : 0x2251,
  484. 'Downarrow' : 0x21d3,
  485. 'Equiv' : 0x2263,
  486. 'Finv' : 0x2132,
  487. 'Game' : 0x2141,
  488. 'Gamma' : 0x393,
  489. 'H' : 0x30b,
  490. 'Im' : 0x2111,
  491. 'Join' : 0x2a1d,
  492. 'L' : 0x141,
  493. 'Lambda' : 0x39b,
  494. 'Ldsh' : 0x21b2,
  495. 'Leftarrow' : 0x21d0,
  496. 'Leftrightarrow' : 0x21d4,
  497. 'Lleftarrow' : 0x21da,
  498. 'Longleftarrow' : 0x27f8,
  499. 'Longleftrightarrow' : 0x27fa,
  500. 'Longrightarrow' : 0x27f9,
  501. 'Lsh' : 0x21b0,
  502. 'Nearrow' : 0x21d7,
  503. 'Nwarrow' : 0x21d6,
  504. 'O' : 0xd8,
  505. 'OE' : 0x152,
  506. 'Omega' : 0x3a9,
  507. 'P' : 0xb6,
  508. 'Phi' : 0x3a6,
  509. 'Pi' : 0x3a0,
  510. 'Psi' : 0x3a8,
  511. 'QED' : 0x220e,
  512. 'Rdsh' : 0x21b3,
  513. 'Re' : 0x211c,
  514. 'Rightarrow' : 0x21d2,
  515. 'Rrightarrow' : 0x21db,
  516. 'Rsh' : 0x21b1,
  517. 'S' : 0xa7,
  518. 'Searrow' : 0x21d8,
  519. 'Sigma' : 0x3a3,
  520. 'Subset' : 0x22d0,
  521. 'Supset' : 0x22d1,
  522. 'Swarrow' : 0x21d9,
  523. 'Theta' : 0x398,
  524. 'Thorn' : 0xde,
  525. 'Uparrow' : 0x21d1,
  526. 'Updownarrow' : 0x21d5,
  527. 'Upsilon' : 0x3a5,
  528. 'Vdash' : 0x22a9,
  529. 'Vert' : 0x2016,
  530. 'Vvdash' : 0x22aa,
  531. 'Xi' : 0x39e,
  532. '_' : 0x5f,
  533. '__sqrt__' : 0x221a,
  534. 'aa' : 0xe5,
  535. 'ac' : 0x223e,
  536. 'acute' : 0x301,
  537. 'acwopencirclearrow' : 0x21ba,
  538. 'adots' : 0x22f0,
  539. 'ae' : 0xe6,
  540. 'aleph' : 0x2135,
  541. 'alpha' : 0x3b1,
  542. 'amalg' : 0x2a3f,
  543. 'angle' : 0x2220,
  544. 'approx' : 0x2248,
  545. 'approxeq' : 0x224a,
  546. 'approxident' : 0x224b,
  547. 'arceq' : 0x2258,
  548. 'ast' : 0x2217,
  549. 'asterisk' : 0x2a,
  550. 'asymp' : 0x224d,
  551. 'backcong' : 0x224c,
  552. 'backepsilon' : 0x3f6,
  553. 'backprime' : 0x2035,
  554. 'backsim' : 0x223d,
  555. 'backsimeq' : 0x22cd,
  556. 'backslash' : 0x5c,
  557. 'bagmember' : 0x22ff,
  558. 'bar' : 0x304,
  559. 'barleftarrow' : 0x21e4,
  560. 'barvee' : 0x22bd,
  561. 'barwedge' : 0x22bc,
  562. 'because' : 0x2235,
  563. 'beta' : 0x3b2,
  564. 'beth' : 0x2136,
  565. 'between' : 0x226c,
  566. 'bigcap' : 0x22c2,
  567. 'bigcirc' : 0x25cb,
  568. 'bigcup' : 0x22c3,
  569. 'bigodot' : 0x2a00,
  570. 'bigoplus' : 0x2a01,
  571. 'bigotimes' : 0x2a02,
  572. 'bigsqcup' : 0x2a06,
  573. 'bigstar' : 0x2605,
  574. 'bigtriangledown' : 0x25bd,
  575. 'bigtriangleup' : 0x25b3,
  576. 'biguplus' : 0x2a04,
  577. 'bigvee' : 0x22c1,
  578. 'bigwedge' : 0x22c0,
  579. 'blacksquare' : 0x25a0,
  580. 'blacktriangle' : 0x25b4,
  581. 'blacktriangledown' : 0x25be,
  582. 'blacktriangleleft' : 0x25c0,
  583. 'blacktriangleright' : 0x25b6,
  584. 'bot' : 0x22a5,
  585. 'bowtie' : 0x22c8,
  586. 'boxbar' : 0x25eb,
  587. 'boxdot' : 0x22a1,
  588. 'boxminus' : 0x229f,
  589. 'boxplus' : 0x229e,
  590. 'boxtimes' : 0x22a0,
  591. 'breve' : 0x306,
  592. 'bullet' : 0x2219,
  593. 'bumpeq' : 0x224f,
  594. 'c' : 0x327,
  595. 'candra' : 0x310,
  596. 'cap' : 0x2229,
  597. 'carriagereturn' : 0x21b5,
  598. 'cdot' : 0x22c5,
  599. 'cdotp' : 0xb7,
  600. 'cdots' : 0x22ef,
  601. 'cent' : 0xa2,
  602. 'check' : 0x30c,
  603. 'checkmark' : 0x2713,
  604. 'chi' : 0x3c7,
  605. 'circ' : 0x2218,
  606. 'circeq' : 0x2257,
  607. 'circlearrowleft' : 0x21ba,
  608. 'circlearrowright' : 0x21bb,
  609. 'circledR' : 0xae,
  610. 'circledS' : 0x24c8,
  611. 'circledast' : 0x229b,
  612. 'circledcirc' : 0x229a,
  613. 'circleddash' : 0x229d,
  614. 'circumflexaccent' : 0x302,
  615. 'clubsuit' : 0x2663,
  616. 'clubsuitopen' : 0x2667,
  617. 'colon' : 0x3a,
  618. 'coloneq' : 0x2254,
  619. 'combiningacuteaccent' : 0x301,
  620. 'combiningbreve' : 0x306,
  621. 'combiningdiaeresis' : 0x308,
  622. 'combiningdotabove' : 0x307,
  623. 'combiningfourdotsabove' : 0x20dc,
  624. 'combininggraveaccent' : 0x300,
  625. 'combiningoverline' : 0x304,
  626. 'combiningrightarrowabove' : 0x20d7,
  627. 'combiningthreedotsabove' : 0x20db,
  628. 'combiningtilde' : 0x303,
  629. 'complement' : 0x2201,
  630. 'cong' : 0x2245,
  631. 'coprod' : 0x2210,
  632. 'copyright' : 0xa9,
  633. 'cup' : 0x222a,
  634. 'cupdot' : 0x228d,
  635. 'cupleftarrow' : 0x228c,
  636. 'curlyeqprec' : 0x22de,
  637. 'curlyeqsucc' : 0x22df,
  638. 'curlyvee' : 0x22ce,
  639. 'curlywedge' : 0x22cf,
  640. 'curvearrowleft' : 0x21b6,
  641. 'curvearrowright' : 0x21b7,
  642. 'cwopencirclearrow' : 0x21bb,
  643. 'd' : 0x323,
  644. 'dag' : 0x2020,
  645. 'dagger' : 0x2020,
  646. 'daleth' : 0x2138,
  647. 'danger' : 0x2621,
  648. 'dashleftarrow' : 0x290e,
  649. 'dashrightarrow' : 0x290f,
  650. 'dashv' : 0x22a3,
  651. 'ddag' : 0x2021,
  652. 'ddagger' : 0x2021,
  653. 'ddddot' : 0x20dc,
  654. 'dddot' : 0x20db,
  655. 'ddot' : 0x308,
  656. 'ddots' : 0x22f1,
  657. 'degree' : 0xb0,
  658. 'delta' : 0x3b4,
  659. 'dh' : 0xf0,
  660. 'diamond' : 0x22c4,
  661. 'diamondsuit' : 0x2662,
  662. 'digamma' : 0x3dd,
  663. 'disin' : 0x22f2,
  664. 'div' : 0xf7,
  665. 'divideontimes' : 0x22c7,
  666. 'dot' : 0x307,
  667. 'doteq' : 0x2250,
  668. 'doteqdot' : 0x2251,
  669. 'dotminus' : 0x2238,
  670. 'dotplus' : 0x2214,
  671. 'dots' : 0x2026,
  672. 'dotsminusdots' : 0x223a,
  673. 'doublebarwedge' : 0x2306,
  674. 'downarrow' : 0x2193,
  675. 'downdownarrows' : 0x21ca,
  676. 'downharpoonleft' : 0x21c3,
  677. 'downharpoonright' : 0x21c2,
  678. 'downzigzagarrow' : 0x21af,
  679. 'ell' : 0x2113,
  680. 'emdash' : 0x2014,
  681. 'emptyset' : 0x2205,
  682. 'endash' : 0x2013,
  683. 'epsilon' : 0x3b5,
  684. 'eqcirc' : 0x2256,
  685. 'eqcolon' : 0x2255,
  686. 'eqdef' : 0x225d,
  687. 'eqgtr' : 0x22dd,
  688. 'eqless' : 0x22dc,
  689. 'eqsim' : 0x2242,
  690. 'eqslantgtr' : 0x2a96,
  691. 'eqslantless' : 0x2a95,
  692. 'equal' : 0x3d,
  693. 'equalparallel' : 0x22d5,
  694. 'equiv' : 0x2261,
  695. 'eta' : 0x3b7,
  696. 'eth' : 0xf0,
  697. 'exists' : 0x2203,
  698. 'fallingdotseq' : 0x2252,
  699. 'flat' : 0x266d,
  700. 'forall' : 0x2200,
  701. 'frakC' : 0x212d,
  702. 'frakZ' : 0x2128,
  703. 'frown' : 0x2322,
  704. 'gamma' : 0x3b3,
  705. 'geq' : 0x2265,
  706. 'geqq' : 0x2267,
  707. 'geqslant' : 0x2a7e,
  708. 'gg' : 0x226b,
  709. 'ggg' : 0x22d9,
  710. 'gimel' : 0x2137,
  711. 'gnapprox' : 0x2a8a,
  712. 'gneqq' : 0x2269,
  713. 'gnsim' : 0x22e7,
  714. 'grave' : 0x300,
  715. 'greater' : 0x3e,
  716. 'gtrapprox' : 0x2a86,
  717. 'gtrdot' : 0x22d7,
  718. 'gtreqless' : 0x22db,
  719. 'gtreqqless' : 0x2a8c,
  720. 'gtrless' : 0x2277,
  721. 'gtrsim' : 0x2273,
  722. 'guillemotleft' : 0xab,
  723. 'guillemotright' : 0xbb,
  724. 'guilsinglleft' : 0x2039,
  725. 'guilsinglright' : 0x203a,
  726. 'hat' : 0x302,
  727. 'hbar' : 0x127,
  728. 'heartsuit' : 0x2661,
  729. 'hermitmatrix' : 0x22b9,
  730. 'hookleftarrow' : 0x21a9,
  731. 'hookrightarrow' : 0x21aa,
  732. 'hslash' : 0x210f,
  733. 'i' : 0x131,
  734. 'iiiint' : 0x2a0c,
  735. 'iiint' : 0x222d,
  736. 'iint' : 0x222c,
  737. 'imageof' : 0x22b7,
  738. 'imath' : 0x131,
  739. 'in' : 0x2208,
  740. 'increment' : 0x2206,
  741. 'infty' : 0x221e,
  742. 'int' : 0x222b,
  743. 'intercal' : 0x22ba,
  744. 'invnot' : 0x2310,
  745. 'iota' : 0x3b9,
  746. 'isinE' : 0x22f9,
  747. 'isindot' : 0x22f5,
  748. 'isinobar' : 0x22f7,
  749. 'isins' : 0x22f4,
  750. 'isinvb' : 0x22f8,
  751. 'jmath' : 0x237,
  752. 'k' : 0x328,
  753. 'kappa' : 0x3ba,
  754. 'kernelcontraction' : 0x223b,
  755. 'l' : 0x142,
  756. 'lambda' : 0x3bb,
  757. 'lambdabar' : 0x19b,
  758. 'langle' : 0x27e8,
  759. 'lasp' : 0x2bd,
  760. 'lbrace' : 0x7b,
  761. 'lbrack' : 0x5b,
  762. 'lceil' : 0x2308,
  763. 'ldots' : 0x2026,
  764. 'leadsto' : 0x21dd,
  765. 'leftarrow' : 0x2190,
  766. 'leftarrowtail' : 0x21a2,
  767. 'leftbrace' : 0x7b,
  768. 'leftharpoonaccent' : 0x20d0,
  769. 'leftharpoondown' : 0x21bd,
  770. 'leftharpoonup' : 0x21bc,
  771. 'leftleftarrows' : 0x21c7,
  772. 'leftparen' : 0x28,
  773. 'leftrightarrow' : 0x2194,
  774. 'leftrightarrows' : 0x21c6,
  775. 'leftrightharpoons' : 0x21cb,
  776. 'leftrightsquigarrow' : 0x21ad,
  777. 'leftsquigarrow' : 0x219c,
  778. 'leftthreetimes' : 0x22cb,
  779. 'leq' : 0x2264,
  780. 'leqq' : 0x2266,
  781. 'leqslant' : 0x2a7d,
  782. 'less' : 0x3c,
  783. 'lessapprox' : 0x2a85,
  784. 'lessdot' : 0x22d6,
  785. 'lesseqgtr' : 0x22da,
  786. 'lesseqqgtr' : 0x2a8b,
  787. 'lessgtr' : 0x2276,
  788. 'lesssim' : 0x2272,
  789. 'lfloor' : 0x230a,
  790. 'lgroup' : 0x27ee,
  791. 'lhd' : 0x25c1,
  792. 'll' : 0x226a,
  793. 'llcorner' : 0x231e,
  794. 'lll' : 0x22d8,
  795. 'lnapprox' : 0x2a89,
  796. 'lneqq' : 0x2268,
  797. 'lnsim' : 0x22e6,
  798. 'longleftarrow' : 0x27f5,
  799. 'longleftrightarrow' : 0x27f7,
  800. 'longmapsto' : 0x27fc,
  801. 'longrightarrow' : 0x27f6,
  802. 'looparrowleft' : 0x21ab,
  803. 'looparrowright' : 0x21ac,
  804. 'lq' : 0x2018,
  805. 'lrcorner' : 0x231f,
  806. 'ltimes' : 0x22c9,
  807. 'macron' : 0xaf,
  808. 'maltese' : 0x2720,
  809. 'mapsdown' : 0x21a7,
  810. 'mapsfrom' : 0x21a4,
  811. 'mapsto' : 0x21a6,
  812. 'mapsup' : 0x21a5,
  813. 'measeq' : 0x225e,
  814. 'measuredangle' : 0x2221,
  815. 'measuredrightangle' : 0x22be,
  816. 'merge' : 0x2a55,
  817. 'mho' : 0x2127,
  818. 'mid' : 0x2223,
  819. 'minus' : 0x2212,
  820. 'minuscolon' : 0x2239,
  821. 'models' : 0x22a7,
  822. 'mp' : 0x2213,
  823. 'mu' : 0x3bc,
  824. 'multimap' : 0x22b8,
  825. 'nLeftarrow' : 0x21cd,
  826. 'nLeftrightarrow' : 0x21ce,
  827. 'nRightarrow' : 0x21cf,
  828. 'nVDash' : 0x22af,
  829. 'nVdash' : 0x22ae,
  830. 'nabla' : 0x2207,
  831. 'napprox' : 0x2249,
  832. 'natural' : 0x266e,
  833. 'ncong' : 0x2247,
  834. 'ne' : 0x2260,
  835. 'nearrow' : 0x2197,
  836. 'neg' : 0xac,
  837. 'neq' : 0x2260,
  838. 'nequiv' : 0x2262,
  839. 'nexists' : 0x2204,
  840. 'ngeq' : 0x2271,
  841. 'ngtr' : 0x226f,
  842. 'ngtrless' : 0x2279,
  843. 'ngtrsim' : 0x2275,
  844. 'ni' : 0x220b,
  845. 'niobar' : 0x22fe,
  846. 'nis' : 0x22fc,
  847. 'nisd' : 0x22fa,
  848. 'nleftarrow' : 0x219a,
  849. 'nleftrightarrow' : 0x21ae,
  850. 'nleq' : 0x2270,
  851. 'nless' : 0x226e,
  852. 'nlessgtr' : 0x2278,
  853. 'nlesssim' : 0x2274,
  854. 'nmid' : 0x2224,
  855. 'not' : 0x338,
  856. 'notin' : 0x2209,
  857. 'notsmallowns' : 0x220c,
  858. 'nparallel' : 0x2226,
  859. 'nprec' : 0x2280,
  860. 'npreccurlyeq' : 0x22e0,
  861. 'nrightarrow' : 0x219b,
  862. 'nsim' : 0x2241,
  863. 'nsimeq' : 0x2244,
  864. 'nsqsubseteq' : 0x22e2,
  865. 'nsqsupseteq' : 0x22e3,
  866. 'nsubset' : 0x2284,
  867. 'nsubseteq' : 0x2288,
  868. 'nsucc' : 0x2281,
  869. 'nsucccurlyeq' : 0x22e1,
  870. 'nsupset' : 0x2285,
  871. 'nsupseteq' : 0x2289,
  872. 'ntriangleleft' : 0x22ea,
  873. 'ntrianglelefteq' : 0x22ec,
  874. 'ntriangleright' : 0x22eb,
  875. 'ntrianglerighteq' : 0x22ed,
  876. 'nu' : 0x3bd,
  877. 'nvDash' : 0x22ad,
  878. 'nvdash' : 0x22ac,
  879. 'nwarrow' : 0x2196,
  880. 'o' : 0xf8,
  881. 'obar' : 0x233d,
  882. 'ocirc' : 0x30a,
  883. 'odot' : 0x2299,
  884. 'oe' : 0x153,
  885. 'oequal' : 0x229c,
  886. 'oiiint' : 0x2230,
  887. 'oiint' : 0x222f,
  888. 'oint' : 0x222e,
  889. 'omega' : 0x3c9,
  890. 'ominus' : 0x2296,
  891. 'oplus' : 0x2295,
  892. 'origof' : 0x22b6,
  893. 'oslash' : 0x2298,
  894. 'otimes' : 0x2297,
  895. 'overarc' : 0x311,
  896. 'overleftarrow' : 0x20d6,
  897. 'overleftrightarrow' : 0x20e1,
  898. 'parallel' : 0x2225,
  899. 'partial' : 0x2202,
  900. 'perp' : 0x27c2,
  901. 'perthousand' : 0x2030,
  902. 'phi' : 0x3d5,
  903. 'pi' : 0x3c0,
  904. 'pitchfork' : 0x22d4,
  905. 'plus' : 0x2b,
  906. 'pm' : 0xb1,
  907. 'prec' : 0x227a,
  908. 'precapprox' : 0x2ab7,
  909. 'preccurlyeq' : 0x227c,
  910. 'preceq' : 0x227c,
  911. 'precnapprox' : 0x2ab9,
  912. 'precnsim' : 0x22e8,
  913. 'precsim' : 0x227e,
  914. 'prime' : 0x2032,
  915. 'prod' : 0x220f,
  916. 'propto' : 0x221d,
  917. 'prurel' : 0x22b0,
  918. 'psi' : 0x3c8,
  919. 'quad' : 0x2003,
  920. 'questeq' : 0x225f,
  921. 'rangle' : 0x27e9,
  922. 'rasp' : 0x2bc,
  923. 'ratio' : 0x2236,
  924. 'rbrace' : 0x7d,
  925. 'rbrack' : 0x5d,
  926. 'rceil' : 0x2309,
  927. 'rfloor' : 0x230b,
  928. 'rgroup' : 0x27ef,
  929. 'rhd' : 0x25b7,
  930. 'rho' : 0x3c1,
  931. 'rightModels' : 0x22ab,
  932. 'rightangle' : 0x221f,
  933. 'rightarrow' : 0x2192,
  934. 'rightarrowbar' : 0x21e5,
  935. 'rightarrowtail' : 0x21a3,
  936. 'rightassert' : 0x22a6,
  937. 'rightbrace' : 0x7d,
  938. 'rightharpoonaccent' : 0x20d1,
  939. 'rightharpoondown' : 0x21c1,
  940. 'rightharpoonup' : 0x21c0,
  941. 'rightleftarrows' : 0x21c4,
  942. 'rightleftharpoons' : 0x21cc,
  943. 'rightparen' : 0x29,
  944. 'rightrightarrows' : 0x21c9,
  945. 'rightsquigarrow' : 0x219d,
  946. 'rightthreetimes' : 0x22cc,
  947. 'rightzigzagarrow' : 0x21dd,
  948. 'ring' : 0x2da,
  949. 'risingdotseq' : 0x2253,
  950. 'rq' : 0x2019,
  951. 'rtimes' : 0x22ca,
  952. 'scrB' : 0x212c,
  953. 'scrE' : 0x2130,
  954. 'scrF' : 0x2131,
  955. 'scrH' : 0x210b,
  956. 'scrI' : 0x2110,
  957. 'scrL' : 0x2112,
  958. 'scrM' : 0x2133,
  959. 'scrR' : 0x211b,
  960. 'scre' : 0x212f,
  961. 'scrg' : 0x210a,
  962. 'scro' : 0x2134,
  963. 'scurel' : 0x22b1,
  964. 'searrow' : 0x2198,
  965. 'setminus' : 0x2216,
  966. 'sharp' : 0x266f,
  967. 'sigma' : 0x3c3,
  968. 'sim' : 0x223c,
  969. 'simeq' : 0x2243,
  970. 'simneqq' : 0x2246,
  971. 'sinewave' : 0x223f,
  972. 'slash' : 0x2215,
  973. 'smallin' : 0x220a,
  974. 'smallintclockwise' : 0x2231,
  975. 'smallointctrcclockwise' : 0x2233,
  976. 'smallowns' : 0x220d,
  977. 'smallsetminus' : 0x2216,
  978. 'smallvarointclockwise' : 0x2232,
  979. 'smile' : 0x2323,
  980. 'solbar' : 0x233f,
  981. 'spadesuit' : 0x2660,
  982. 'spadesuitopen' : 0x2664,
  983. 'sphericalangle' : 0x2222,
  984. 'sqcap' : 0x2293,
  985. 'sqcup' : 0x2294,
  986. 'sqsubset' : 0x228f,
  987. 'sqsubseteq' : 0x2291,
  988. 'sqsubsetneq' : 0x22e4,
  989. 'sqsupset' : 0x2290,
  990. 'sqsupseteq' : 0x2292,
  991. 'sqsupsetneq' : 0x22e5,
  992. 'ss' : 0xdf,
  993. 'star' : 0x22c6,
  994. 'stareq' : 0x225b,
  995. 'sterling' : 0xa3,
  996. 'subset' : 0x2282,
  997. 'subseteq' : 0x2286,
  998. 'subseteqq' : 0x2ac5,
  999. 'subsetneq' : 0x228a,
  1000. 'subsetneqq' : 0x2acb,
  1001. 'succ' : 0x227b,
  1002. 'succapprox' : 0x2ab8,
  1003. 'succcurlyeq' : 0x227d,
  1004. 'succeq' : 0x227d,
  1005. 'succnapprox' : 0x2aba,
  1006. 'succnsim' : 0x22e9,
  1007. 'succsim' : 0x227f,
  1008. 'sum' : 0x2211,
  1009. 'supset' : 0x2283,
  1010. 'supseteq' : 0x2287,
  1011. 'supseteqq' : 0x2ac6,
  1012. 'supsetneq' : 0x228b,
  1013. 'supsetneqq' : 0x2acc,
  1014. 'swarrow' : 0x2199,
  1015. 't' : 0x361,
  1016. 'tau' : 0x3c4,
  1017. 'textasciiacute' : 0xb4,
  1018. 'textasciicircum' : 0x5e,
  1019. 'textasciigrave' : 0x60,
  1020. 'textasciitilde' : 0x7e,
  1021. 'textexclamdown' : 0xa1,
  1022. 'textquestiondown' : 0xbf,
  1023. 'textquotedblleft' : 0x201c,
  1024. 'textquotedblright' : 0x201d,
  1025. 'therefore' : 0x2234,
  1026. 'theta' : 0x3b8,
  1027. 'thickspace' : 0x2005,
  1028. 'thorn' : 0xfe,
  1029. 'tilde' : 0x303,
  1030. 'times' : 0xd7,
  1031. 'to' : 0x2192,
  1032. 'top' : 0x22a4,
  1033. 'triangle' : 0x25b3,
  1034. 'triangledown' : 0x25bf,
  1035. 'triangleeq' : 0x225c,
  1036. 'triangleleft' : 0x25c1,
  1037. 'trianglelefteq' : 0x22b4,
  1038. 'triangleq' : 0x225c,
  1039. 'triangleright' : 0x25b7,
  1040. 'trianglerighteq' : 0x22b5,
  1041. 'turnednot' : 0x2319,
  1042. 'twoheaddownarrow' : 0x21a1,
  1043. 'twoheadleftarrow' : 0x219e,
  1044. 'twoheadrightarrow' : 0x21a0,
  1045. 'twoheaduparrow' : 0x219f,
  1046. 'ulcorner' : 0x231c,
  1047. 'underbar' : 0x331,
  1048. 'unlhd' : 0x22b4,
  1049. 'unrhd' : 0x22b5,
  1050. 'uparrow' : 0x2191,
  1051. 'updownarrow' : 0x2195,
  1052. 'updownarrowbar' : 0x21a8,
  1053. 'updownarrows' : 0x21c5,
  1054. 'upharpoonleft' : 0x21bf,
  1055. 'upharpoonright' : 0x21be,
  1056. 'uplus' : 0x228e,
  1057. 'upsilon' : 0x3c5,
  1058. 'upuparrows' : 0x21c8,
  1059. 'urcorner' : 0x231d,
  1060. 'vDash' : 0x22a8,
  1061. 'varepsilon' : 0x3b5,
  1062. 'varisinobar' : 0x22f6,
  1063. 'varisins' : 0x22f3,
  1064. 'varkappa' : 0x3f0,
  1065. 'varlrtriangle' : 0x22bf,
  1066. 'varniobar' : 0x22fd,
  1067. 'varnis' : 0x22fb,
  1068. 'varnothing' : 0x2205,
  1069. 'varphi' : 0x3c6,
  1070. 'varpi' : 0x3d6,
  1071. 'varpropto' : 0x221d,
  1072. 'varrho' : 0x3f1,
  1073. 'varsigma' : 0x3c2,
  1074. 'vartheta' : 0x3d1,
  1075. 'vartriangle' : 0x25b5,
  1076. 'vartriangleleft' : 0x22b2,
  1077. 'vartriangleright' : 0x22b3,
  1078. 'vdash' : 0x22a2,
  1079. 'vdots' : 0x22ee,
  1080. 'vec' : 0x20d7,
  1081. 'vee' : 0x2228,
  1082. 'veebar' : 0x22bb,
  1083. 'veeeq' : 0x225a,
  1084. 'vert' : 0x7c,
  1085. 'wedge' : 0x2227,
  1086. 'wedgeq' : 0x2259,
  1087. 'widebar' : 0x305,
  1088. 'widehat' : 0x302,
  1089. 'widetilde' : 0x303,
  1090. 'wp' : 0x2118,
  1091. 'wr' : 0x2240,
  1092. 'xi' : 0x3be,
  1093. 'yen' : 0xa5,
  1094. 'zeta' : 0x3b6,
  1095. '{' : 0x7b,
  1096. '|' : 0x2016,
  1097. '}' : 0x7d,
  1098. }
  1099. # Each element is a 4-tuple of the form:
  1100. # src_start, src_end, dst_font, dst_start
  1101. #
  1102. stix_virtual_fonts: dict[str, dict[str, list[tuple[int, int, str, int]]] |
  1103. list[tuple[int, int, str, int]]] = {
  1104. 'bb':
  1105. {
  1106. 'rm':
  1107. [
  1108. (0x0030, 0x0039, 'rm', 0x1d7d8), # 0-9
  1109. (0x0041, 0x0042, 'rm', 0x1d538), # A-B
  1110. (0x0043, 0x0043, 'rm', 0x2102), # C
  1111. (0x0044, 0x0047, 'rm', 0x1d53b), # D-G
  1112. (0x0048, 0x0048, 'rm', 0x210d), # H
  1113. (0x0049, 0x004d, 'rm', 0x1d540), # I-M
  1114. (0x004e, 0x004e, 'rm', 0x2115), # N
  1115. (0x004f, 0x004f, 'rm', 0x1d546), # O
  1116. (0x0050, 0x0051, 'rm', 0x2119), # P-Q
  1117. (0x0052, 0x0052, 'rm', 0x211d), # R
  1118. (0x0053, 0x0059, 'rm', 0x1d54a), # S-Y
  1119. (0x005a, 0x005a, 'rm', 0x2124), # Z
  1120. (0x0061, 0x007a, 'rm', 0x1d552), # a-z
  1121. (0x0393, 0x0393, 'rm', 0x213e), # \Gamma
  1122. (0x03a0, 0x03a0, 'rm', 0x213f), # \Pi
  1123. (0x03a3, 0x03a3, 'rm', 0x2140), # \Sigma
  1124. (0x03b3, 0x03b3, 'rm', 0x213d), # \gamma
  1125. (0x03c0, 0x03c0, 'rm', 0x213c), # \pi
  1126. ],
  1127. 'it':
  1128. [
  1129. (0x0030, 0x0039, 'rm', 0x1d7d8), # 0-9
  1130. (0x0041, 0x0042, 'it', 0xe154), # A-B
  1131. (0x0043, 0x0043, 'it', 0x2102), # C
  1132. (0x0044, 0x0044, 'it', 0x2145), # D
  1133. (0x0045, 0x0047, 'it', 0xe156), # E-G
  1134. (0x0048, 0x0048, 'it', 0x210d), # H
  1135. (0x0049, 0x004d, 'it', 0xe159), # I-M
  1136. (0x004e, 0x004e, 'it', 0x2115), # N
  1137. (0x004f, 0x004f, 'it', 0xe15e), # O
  1138. (0x0050, 0x0051, 'it', 0x2119), # P-Q
  1139. (0x0052, 0x0052, 'it', 0x211d), # R
  1140. (0x0053, 0x0059, 'it', 0xe15f), # S-Y
  1141. (0x005a, 0x005a, 'it', 0x2124), # Z
  1142. (0x0061, 0x0063, 'it', 0xe166), # a-c
  1143. (0x0064, 0x0065, 'it', 0x2146), # d-e
  1144. (0x0066, 0x0068, 'it', 0xe169), # f-h
  1145. (0x0069, 0x006a, 'it', 0x2148), # i-j
  1146. (0x006b, 0x007a, 'it', 0xe16c), # k-z
  1147. (0x0393, 0x0393, 'it', 0x213e), # \Gamma (not in beta STIX fonts)
  1148. (0x03a0, 0x03a0, 'it', 0x213f), # \Pi
  1149. (0x03a3, 0x03a3, 'it', 0x2140), # \Sigma (not in beta STIX fonts)
  1150. (0x03b3, 0x03b3, 'it', 0x213d), # \gamma (not in beta STIX fonts)
  1151. (0x03c0, 0x03c0, 'it', 0x213c), # \pi
  1152. ],
  1153. 'bf':
  1154. [
  1155. (0x0030, 0x0039, 'rm', 0x1d7d8), # 0-9
  1156. (0x0041, 0x0042, 'bf', 0xe38a), # A-B
  1157. (0x0043, 0x0043, 'bf', 0x2102), # C
  1158. (0x0044, 0x0044, 'bf', 0x2145), # D
  1159. (0x0045, 0x0047, 'bf', 0xe38d), # E-G
  1160. (0x0048, 0x0048, 'bf', 0x210d), # H
  1161. (0x0049, 0x004d, 'bf', 0xe390), # I-M
  1162. (0x004e, 0x004e, 'bf', 0x2115), # N
  1163. (0x004f, 0x004f, 'bf', 0xe395), # O
  1164. (0x0050, 0x0051, 'bf', 0x2119), # P-Q
  1165. (0x0052, 0x0052, 'bf', 0x211d), # R
  1166. (0x0053, 0x0059, 'bf', 0xe396), # S-Y
  1167. (0x005a, 0x005a, 'bf', 0x2124), # Z
  1168. (0x0061, 0x0063, 'bf', 0xe39d), # a-c
  1169. (0x0064, 0x0065, 'bf', 0x2146), # d-e
  1170. (0x0066, 0x0068, 'bf', 0xe3a2), # f-h
  1171. (0x0069, 0x006a, 'bf', 0x2148), # i-j
  1172. (0x006b, 0x007a, 'bf', 0xe3a7), # k-z
  1173. (0x0393, 0x0393, 'bf', 0x213e), # \Gamma
  1174. (0x03a0, 0x03a0, 'bf', 0x213f), # \Pi
  1175. (0x03a3, 0x03a3, 'bf', 0x2140), # \Sigma
  1176. (0x03b3, 0x03b3, 'bf', 0x213d), # \gamma
  1177. (0x03c0, 0x03c0, 'bf', 0x213c), # \pi
  1178. ],
  1179. },
  1180. 'cal':
  1181. [
  1182. (0x0041, 0x005a, 'it', 0xe22d), # A-Z
  1183. ],
  1184. 'frak':
  1185. {
  1186. 'rm':
  1187. [
  1188. (0x0041, 0x0042, 'rm', 0x1d504), # A-B
  1189. (0x0043, 0x0043, 'rm', 0x212d), # C
  1190. (0x0044, 0x0047, 'rm', 0x1d507), # D-G
  1191. (0x0048, 0x0048, 'rm', 0x210c), # H
  1192. (0x0049, 0x0049, 'rm', 0x2111), # I
  1193. (0x004a, 0x0051, 'rm', 0x1d50d), # J-Q
  1194. (0x0052, 0x0052, 'rm', 0x211c), # R
  1195. (0x0053, 0x0059, 'rm', 0x1d516), # S-Y
  1196. (0x005a, 0x005a, 'rm', 0x2128), # Z
  1197. (0x0061, 0x007a, 'rm', 0x1d51e), # a-z
  1198. ],
  1199. 'bf':
  1200. [
  1201. (0x0041, 0x005a, 'bf', 0x1d56c), # A-Z
  1202. (0x0061, 0x007a, 'bf', 0x1d586), # a-z
  1203. ],
  1204. },
  1205. 'scr':
  1206. [
  1207. (0x0041, 0x0041, 'it', 0x1d49c), # A
  1208. (0x0042, 0x0042, 'it', 0x212c), # B
  1209. (0x0043, 0x0044, 'it', 0x1d49e), # C-D
  1210. (0x0045, 0x0046, 'it', 0x2130), # E-F
  1211. (0x0047, 0x0047, 'it', 0x1d4a2), # G
  1212. (0x0048, 0x0048, 'it', 0x210b), # H
  1213. (0x0049, 0x0049, 'it', 0x2110), # I
  1214. (0x004a, 0x004b, 'it', 0x1d4a5), # J-K
  1215. (0x004c, 0x004c, 'it', 0x2112), # L
  1216. (0x004d, 0x004d, 'it', 0x2133), # M
  1217. (0x004e, 0x0051, 'it', 0x1d4a9), # N-Q
  1218. (0x0052, 0x0052, 'it', 0x211b), # R
  1219. (0x0053, 0x005a, 'it', 0x1d4ae), # S-Z
  1220. (0x0061, 0x0064, 'it', 0x1d4b6), # a-d
  1221. (0x0065, 0x0065, 'it', 0x212f), # e
  1222. (0x0066, 0x0066, 'it', 0x1d4bb), # f
  1223. (0x0067, 0x0067, 'it', 0x210a), # g
  1224. (0x0068, 0x006e, 'it', 0x1d4bd), # h-n
  1225. (0x006f, 0x006f, 'it', 0x2134), # o
  1226. (0x0070, 0x007a, 'it', 0x1d4c5), # p-z
  1227. ],
  1228. 'sf':
  1229. {
  1230. 'rm':
  1231. [
  1232. (0x0030, 0x0039, 'rm', 0x1d7e2), # 0-9
  1233. (0x0041, 0x005a, 'rm', 0x1d5a0), # A-Z
  1234. (0x0061, 0x007a, 'rm', 0x1d5ba), # a-z
  1235. (0x0391, 0x03a9, 'rm', 0xe17d), # \Alpha-\Omega
  1236. (0x03b1, 0x03c9, 'rm', 0xe196), # \alpha-\omega
  1237. (0x03d1, 0x03d1, 'rm', 0xe1b0), # theta variant
  1238. (0x03d5, 0x03d5, 'rm', 0xe1b1), # phi variant
  1239. (0x03d6, 0x03d6, 'rm', 0xe1b3), # pi variant
  1240. (0x03f1, 0x03f1, 'rm', 0xe1b2), # rho variant
  1241. (0x03f5, 0x03f5, 'rm', 0xe1af), # lunate epsilon
  1242. (0x2202, 0x2202, 'rm', 0xe17c), # partial differential
  1243. ],
  1244. 'it':
  1245. [
  1246. # These numerals are actually upright. We don't actually
  1247. # want italic numerals ever.
  1248. (0x0030, 0x0039, 'rm', 0x1d7e2), # 0-9
  1249. (0x0041, 0x005a, 'it', 0x1d608), # A-Z
  1250. (0x0061, 0x007a, 'it', 0x1d622), # a-z
  1251. (0x0391, 0x03a9, 'rm', 0xe17d), # \Alpha-\Omega
  1252. (0x03b1, 0x03c9, 'it', 0xe1d8), # \alpha-\omega
  1253. (0x03d1, 0x03d1, 'it', 0xe1f2), # theta variant
  1254. (0x03d5, 0x03d5, 'it', 0xe1f3), # phi variant
  1255. (0x03d6, 0x03d6, 'it', 0xe1f5), # pi variant
  1256. (0x03f1, 0x03f1, 'it', 0xe1f4), # rho variant
  1257. (0x03f5, 0x03f5, 'it', 0xe1f1), # lunate epsilon
  1258. ],
  1259. 'bf':
  1260. [
  1261. (0x0030, 0x0039, 'bf', 0x1d7ec), # 0-9
  1262. (0x0041, 0x005a, 'bf', 0x1d5d4), # A-Z
  1263. (0x0061, 0x007a, 'bf', 0x1d5ee), # a-z
  1264. (0x0391, 0x03a9, 'bf', 0x1d756), # \Alpha-\Omega
  1265. (0x03b1, 0x03c9, 'bf', 0x1d770), # \alpha-\omega
  1266. (0x03d1, 0x03d1, 'bf', 0x1d78b), # theta variant
  1267. (0x03d5, 0x03d5, 'bf', 0x1d78d), # phi variant
  1268. (0x03d6, 0x03d6, 'bf', 0x1d78f), # pi variant
  1269. (0x03f0, 0x03f0, 'bf', 0x1d78c), # kappa variant
  1270. (0x03f1, 0x03f1, 'bf', 0x1d78e), # rho variant
  1271. (0x03f5, 0x03f5, 'bf', 0x1d78a), # lunate epsilon
  1272. (0x2202, 0x2202, 'bf', 0x1d789), # partial differential
  1273. (0x2207, 0x2207, 'bf', 0x1d76f), # \Nabla
  1274. ],
  1275. 'bfit':
  1276. [
  1277. (0x0041, 0x005a, 'bfit', 0x1d468), # A-Z
  1278. (0x0061, 0x007a, 'bfit', 0x1d482), # a-z
  1279. (0x0393, 0x03a9, 'bfit', 0x1d71e), # \Gamma-\Omega
  1280. (0x03b1, 0x03c9, 'bfit', 0x1d736), # \alpha-\omega
  1281. ],
  1282. },
  1283. 'tt':
  1284. [
  1285. (0x0030, 0x0039, 'rm', 0x1d7f6), # 0-9
  1286. (0x0041, 0x005a, 'rm', 0x1d670), # A-Z
  1287. (0x0061, 0x007a, 'rm', 0x1d68a) # a-z
  1288. ],
  1289. }
  1290. # Fix some incorrect glyphs.
  1291. stix_glyph_fixes = {
  1292. # Cap and Cup glyphs are swapped.
  1293. 0x22d2: 0x22d3,
  1294. 0x22d3: 0x22d2,
  1295. }