www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

fontdata-extra.js (7813B)


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