fontdata-extra.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /* -*- Mode: Javascript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
  2. /* vim: set ts=2 et sw=2 tw=80: */
  3. /*************************************************************
  4. *
  5. * MathJax/jax/output/HTML-CSS/fonts/TeX/fontdata-extra.js
  6. *
  7. * Adds extra stretchy characters to the TeX font data.
  8. *
  9. * ---------------------------------------------------------------------
  10. *
  11. * Copyright (c) 2011-2017 The MathJax Consortium
  12. *
  13. * Licensed under the Apache License, Version 2.0 (the "License");
  14. * you may not use this file except in compliance with the License.
  15. * You may obtain a copy of the License at
  16. *
  17. * http://www.apache.org/licenses/LICENSE-2.0
  18. *
  19. * Unless required by applicable law or agreed to in writing, software
  20. * distributed under the License is distributed on an "AS IS" BASIS,
  21. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the License for the specific language governing permissions and
  23. * limitations under the License.
  24. */
  25. (function (HTMLCSS) {
  26. var VERSION = "2.7.2";
  27. var DELIMITERS = HTMLCSS.FONTDATA.DELIMITERS;
  28. var MAIN = "MathJax_Main",
  29. BOLD = "MathJax_Main-bold",
  30. AMS = "MathJax_AMS",
  31. SIZE1 = "MathJax_Size1",
  32. SIZE4 = "MathJax_Size4";
  33. var H = "H", V = "V";
  34. var ARROWREP = [0x2212,MAIN,0,0,0,-.3,-.3]; // remove extra height/depth added below
  35. var DARROWREP = [0x3D,MAIN,0,0,0,0,.1]; // add depth for arrow extender
  36. var delim = {
  37. 0x003D: // equal sign
  38. {
  39. dir: H, HW: [[.767,MAIN]], stretch: {rep:[0x003D,MAIN]}
  40. },
  41. 0x219E: // left two-headed arrow
  42. {
  43. dir: H, HW: [[1,AMS]], stretch: {left:[0x219E,AMS], rep:ARROWREP}
  44. },
  45. 0x21A0: // right two-headed arrow
  46. {
  47. dir: H, HW: [[1,AMS]], stretch: {right:[0x21A0,AMS], rep:ARROWREP}
  48. },
  49. 0x21A4: // left arrow from bar
  50. {
  51. dir: H, HW: [],
  52. stretch: {min:1, left:[0x2190,MAIN], rep:ARROWREP, right:[0x2223,SIZE1,0,-.05,.9]}
  53. },
  54. 0x21A5: // up arrow from bar
  55. {
  56. dir: V, HW: [],
  57. stretch: {min:.6, bot:[0x22A5,BOLD,0,0,.75], ext:[0x23D0,SIZE1], top:[0x2191,SIZE1]}
  58. },
  59. 0x21A6: // right arrow from bar
  60. {
  61. dir: H, HW: [[1,MAIN]],
  62. stretch: {left:[0x2223,SIZE1,-.09,-.05,.9], rep:ARROWREP, right:[0x2192,MAIN]}
  63. },
  64. 0x21A7: // down arrow from bar
  65. {
  66. dir: V, HW: [],
  67. stretch: {min:.6, top:[0x22A4,BOLD,0,0,.75], ext:[0x23D0,SIZE1], bot:[0x2193,SIZE1]}
  68. },
  69. 0x21B0: // up arrow with top leftwards
  70. {
  71. dir: V, HW: [[.722,AMS]],
  72. stretch: {top:[0x21B0,AMS], ext:[0x23D0,SIZE1,.097]}
  73. },
  74. 0x21B1: // up arrow with top right
  75. {
  76. dir: V, HW: [[.722,AMS]],
  77. stretch: {top:[0x21B1,AMS,.27], ext:[0x23D0,SIZE1]}
  78. },
  79. 0x21BC: // left harpoon with barb up
  80. {
  81. dir: H, HW: [[1,MAIN]],
  82. stretch: {left:[0x21BC,MAIN], rep:ARROWREP}
  83. },
  84. 0x21BD: // left harpoon with barb down
  85. {
  86. dir: H, HW: [[1,MAIN]],
  87. stretch: {left:[0x21BD,MAIN], rep:ARROWREP}
  88. },
  89. 0x21BE: // up harpoon with barb right
  90. {
  91. dir: V, HW: [[.888,AMS]],
  92. stretch: {top:[0x21BE,AMS,.12,0,1.1], ext:[0x23D0,SIZE1]}
  93. },
  94. 0x21BF: // up harpoon with barb left
  95. {
  96. dir: V, HW: [[.888,AMS]],
  97. stretch: {top:[0x21BF,AMS,.12,0,1.1], ext:[0x23D0,SIZE1]}
  98. },
  99. 0x21C0: // right harpoon with barb up
  100. {
  101. dir: H, HW: [[1,MAIN]],
  102. stretch: {right:[0x21C0,MAIN], rep:ARROWREP}
  103. },
  104. 0x21C1: // right harpoon with barb down
  105. {
  106. dir: H, HW: [[1,MAIN]],
  107. stretch: {right:[0x21C1,MAIN], rep:ARROWREP}
  108. },
  109. 0x21C2: // down harpoon with barb right
  110. {
  111. dir: V, HW: [[.888,AMS]],
  112. stretch: {bot:[0x21C2,AMS,.12,0,1.1], ext:[0x23D0,SIZE1]}
  113. },
  114. 0x21C3: // down harpoon with barb left
  115. {
  116. dir: V, HW: [[.888,AMS]],
  117. stretch: {bot:[0x21C3,AMS,.12,0,1.1], ext:[0x23D0,SIZE1]}
  118. },
  119. 0x21DA: // left triple arrow
  120. {
  121. dir: H, HW: [[1,AMS]],
  122. stretch: {left:[0x21DA,AMS], rep:[0x2261,MAIN]}
  123. },
  124. 0x21DB: // right triple arrow
  125. {
  126. dir: H, HW: [[1,AMS]],
  127. stretch: {right:[0x21DB,AMS], rep:[0x2261,MAIN]}
  128. },
  129. 0x23B4: // top square bracket
  130. {
  131. dir: H, HW: [],
  132. stretch: {min:.5, left:[0x250C,AMS,0,-.1], rep:[0x2212,MAIN,0,.35], right:[0x2510,AMS,0,-.1]}
  133. },
  134. 0x23B5: // bottom square bracket
  135. {
  136. dir: H, HW: [],
  137. stretch: {min:.5, left:[0x2514,AMS,0,.26], rep:[0x2212,MAIN,0,0,0,.25], right:[0x2518,AMS,0,.26]}
  138. },
  139. 0x23DC: // top paren
  140. {
  141. dir: H, HW: [[.778,AMS,0,0x2322],[1,MAIN,0,0x2322]],
  142. stretch: {left:[0xE150,SIZE4], rep:[0xE154,SIZE4], right:[0xE151,SIZE4]}
  143. },
  144. 0x23DD: // bottom paren
  145. {
  146. dir: H, HW: [[.778,AMS,0,0x2323],[1,MAIN,0,0x2323]],
  147. stretch: {left:[0xE152,SIZE4], rep:[0xE154,SIZE4], right:[0xE153,SIZE4]}
  148. },
  149. 0x23E0: // top tortoise shell
  150. {
  151. dir: H, HW: [],
  152. stretch: {min:1.25, left:[0x2CA,MAIN,-.1], rep:[0x2C9,MAIN,0,.13], right:[0x2CB,MAIN], fullExtenders:true}
  153. },
  154. 0x23E1: // bottom tortoise shell
  155. {
  156. dir: H, HW: [],
  157. stretch: {min:1.5, left:[0x2CB,MAIN,-.1,.1], rep:[0x2C9,MAIN], right:[0x2CA,MAIN,-.1,.1], fullExtenders:true}
  158. },
  159. 0x2906: // leftwards double arrow from bar
  160. {
  161. dir: H, HW: [],
  162. stretch: {min:1, left:[0x21D0,MAIN], rep:DARROWREP, right:[0x2223,SIZE1,0,-.1]}
  163. },
  164. 0x2907: // rightwards double arrow from bar
  165. {
  166. dir: H, HW: [],
  167. stretch: {min:.7, left:[0x22A8,AMS,0,-.12], rep:DARROWREP, right:[0x21D2,MAIN]}
  168. },
  169. 0x294E: // left barb up right barb up harpoon
  170. {
  171. dir: H, HW: [],
  172. stretch: {min:.5, left:[0x21BC,MAIN], rep:ARROWREP, right:[0x21C0,MAIN]}
  173. },
  174. 0x294F: // up barb right down barb right harpoon
  175. {
  176. dir: V, HW: [],
  177. stretch: {min:.5, top:[0x21BE,AMS,.12,0,1.1], ext:[0x23D0,SIZE1], bot:[0x21C2,AMS,.12,0,1.1]}
  178. },
  179. 0x2950: // left barb dow right barb down harpoon
  180. {
  181. dir: H, HW: [],
  182. stretch: {min:.5, left:[0x21BD,MAIN], rep:ARROWREP, right:[0x21C1,MAIN]}
  183. },
  184. 0x2951: // up barb left down barb left harpoon
  185. {
  186. dir: V, HW: [],
  187. stretch: {min:.5, top:[0x21BF,AMS,.12,0,1.1], ext:[0x23D0,SIZE1], bot:[0x21C3,AMS,.12,0,1.1]}
  188. },
  189. 0x295A: // leftwards harpoon with barb up from bar
  190. {
  191. dir: H, HW: [],
  192. stretch: {min:1, left:[0x21BC,MAIN], rep:ARROWREP, right:[0x2223,SIZE1,0,-.05,.9]}
  193. },
  194. 0x295B: // rightwards harpoon with barb up from bar
  195. {
  196. dir: H, HW: [],
  197. stretch: {min:1, left:[0x2223,SIZE1,-.05,-.05,.9], rep:ARROWREP, right:[0x21C0,MAIN]}
  198. },
  199. 0x295C: // up harpoon with barb right from bar
  200. {
  201. dir: V, HW: [],
  202. stretch: {min:.7, bot:[0x22A5,BOLD,0,0,.75], ext:[0x23D0,SIZE1], top:[0x21BE,AMS,.12,0,1.1]}
  203. },
  204. 0x295D: // down harpoon with barb right from bar
  205. {
  206. dir: V, HW: [],
  207. stretch: {min:.7, top:[0x22A4,BOLD,0,0,.75], ext:[0x23D0,SIZE1], bot:[0x21C2,AMS,.12,0,1.1]}
  208. },
  209. 0x295E: // leftwards harpoon with barb down from bar
  210. {
  211. dir: H, HW: [],
  212. stretch: {min:1, left:[0x21BD,MAIN], rep:ARROWREP, right:[0x2223,SIZE1,0,-.05,.9]}
  213. },
  214. 0x295F: // rightwards harpoon with barb down from bar
  215. {
  216. dir: H, HW: [],
  217. stretch: {min:1, left:[0x2223,SIZE1,-.05,-.05,.9], rep:ARROWREP, right:[0x21C1,MAIN]}
  218. },
  219. 0x2960: // up harpoon with barb left from bar
  220. {
  221. dir: V, HW: [],
  222. stretch: {min:.7, bot:[0x22A5,BOLD,0,0,.75], ext:[0x23D0,SIZE1], top:[0x21BF,AMS,.12,0,1.1]}
  223. },
  224. 0x2961: // down harpoon with barb left from bar
  225. {
  226. dir: V, HW: [],
  227. stretch: {min:.7, top:[0x22A4,BOLD,0,0,.75], ext:[0x23D0,SIZE1], bot:[0x21C3,AMS,.12,0,1.1]}
  228. }
  229. };
  230. for (var id in delim) {if (delim.hasOwnProperty(id)) {DELIMITERS[id] = delim[id]}};
  231. MathJax.Ajax.loadComplete(HTMLCSS.fontDir + "/fontdata-extra.js");
  232. })(MathJax.OutputJax["HTML-CSS"]);