fontdata-1.0.js (10989B)
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/HTML-CSS/font/STIX/fontdata-1.0.js 7 * 8 * Patches the STIX font data to work with version 1.0 of 9 * the STIX fonts (this is a delta from the v1.1 fonts). 10 * 11 * --------------------------------------------------------------------- 12 * 13 * Copyright (c) 2012-2015 The MathJax Consortium 14 * 15 * Licensed under the Apache License, Version 2.0 (the "License"); 16 * you may not use this file except in compliance with the License. 17 * You may obtain a copy of the License at 18 * 19 * http://www.apache.org/licenses/LICENSE-2.0 20 * 21 * Unless required by applicable law or agreed to in writing, software 22 * distributed under the License is distributed on an "AS IS" BASIS, 23 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 * See the License for the specific language governing permissions and 25 * limitations under the License. 26 */ 27 28 (function (HTMLCSS,HUB) { 29 30 var UPDATE = function (file,add,remove) { 31 var name = "STIX"+file.replace(/\/[^\/]*$/,'').replace(/\//,'-').replace(/-Regular/,''); 32 name = name.replace(/-B/,'-b').replace(/-I/,'-i').replace(/-boldItalic/,'-bold-italic'); 33 HUB.Register.LoadHook(HTMLCSS.fontDir+"/"+file+".js",function () { 34 var FONT = HTMLCSS.FONTDATA.FONTS[name]; 35 for (var id in add) {if (add.hasOwnProperty(id)) {FONT[id] = add[id]}} 36 if (remove) {for (var i = 0, m = remove.length; i < m; i++) {delete FONT[remove[i]]}} 37 }); 38 }; 39 40 HTMLCSS.FONTDATA.STIXversion = "1.0"; 41 42 delete HTMLCSS.FONTDATA.FONTS["STIXGeneral-bold"].Ranges["LatinExtendedD"]; 43 delete HTMLCSS.FONTDATA.FONTS["STIXGeneral-bold"].Ranges["BBBold"]; 44 45 HTMLCSS.FONTDATA.DELIMITERS[0x23DE].HW[0] = [.556,"STIXGeneral"]; 46 HTMLCSS.FONTDATA.DELIMITERS[0x23DE].HW[1] = [.926,"STIXSizeOneSym"]; 47 HTMLCSS.FONTDATA.DELIMITERS[0x23DF].HW[0] = [.556,"STIXGeneral"]; 48 HTMLCSS.FONTDATA.DELIMITERS[0x23DF].HW[1] = [.926,"STIXSizeOneSym"]; 49 50 HUB.Register.LoadHook(HTMLCSS.fontDir+"/fontdata-extra.js",function () { 51 HTMLCSS.FONTDATA.DELIMITERS[0x23DC].HW[0] = [.556,"STIXGeneral"]; 52 HTMLCSS.FONTDATA.DELIMITERS[0x23DC].HW[1] = [.926,"STIXSizeOneSym"]; 53 HTMLCSS.FONTDATA.DELIMITERS[0x23DD].HW[0] = [.556,"STIXGeneral"]; 54 HTMLCSS.FONTDATA.DELIMITERS[0x23DD].HW[1] = [.926,"STIXSizeOneSym"]; 55 HTMLCSS.FONTDATA.DELIMITERS[0x23E0].HW[0][0] = .926; 56 HTMLCSS.FONTDATA.DELIMITERS[0x23E1].HW[0][0] = .926; 57 }); 58 59 UPDATE("General/Bold/CombDiacritMarks",{},[0x347]); 60 61 UPDATE("General/Bold/LetterlikeSymbols",{ 62 0x2145: [676,0,748,75,703], // stix-mathematical bold double-struck capital D 63 0x2146: [676,14,643,50,583], // stix-mathematical bold double-struck small letter d 64 0x2147: [473,14,573,50,523], // stix-mathematical bold double-struck small letter e 65 0x2148: [691,0,330,65,265], // stix-mathematical bold double-struck small letter i 66 0x2149: [691,205,371,-20,311] // stix-mathematical bold double-struck small letter j 67 }); 68 69 UPDATE("General/Bold/MathOperators",{ 70 0x2219: [473,-59,584,85,499] // BULLET OPERATOR 71 },[0x22C0,0x22C1,0x22C2,0x22C3]); 72 73 UPDATE("General/Bold/SpacingModLetters",{},[0x2F7]); 74 75 UPDATE("General/BoldItalic/GeneralPunctuation",{ 76 0x203E: [637,-565,500,0,500] // OVERLINE 77 }); 78 79 UPDATE("General/BoldItalic/GreekBoldItalic",{ 80 0x1D730: [685,0,589,31,721] // MATHEMATICAL BOLD ITALIC CAPITAL UPSILON 81 }); 82 83 UPDATE("General/BoldItalic/SpacingModLetters",{ 84 0x2B2: [1017,-331,350,24,384] // MODIFIER LETTER SMALL J 85 },[0x2F7]); 86 87 UPDATE("General/Italic/CombDiactForSymbols",{ 88 0x20EC: [681,-548,0,-453,-17], // COMBINING RIGHTWARDS HARPOON WITH BARB DOWNWARDS 89 0x20ED: [681,-548,0,-453,-17] // COMBINING LEFTWARDS HARPOON WITH BARB DOWNWARDS 90 }); 91 92 UPDATE("General/Italic/GeneralPunctuation",{ 93 0x203E: [582,-532,500,0,500] // OVERLINE 94 }); 95 96 UPDATE("General/Italic/GreekItalic",{ 97 0x1D6F6: [668,0,567,28,687] // MATHEMATICAL ITALIC CAPITAL UPSILON 98 }); 99 100 UPDATE("General/Italic/SpacingModLetters",{},[0x2F7]); 101 102 UPDATE("General/Regular/CombDiacritMarks",{},[0x347]); 103 104 UPDATE("General/Regular/GreekBoldItalic",{ 105 0x1D730: [685,0,589,31,721] // MATHEMATICAL BOLD ITALIC CAPITAL UPSILON 106 }); 107 108 UPDATE("General/Regular/GreekItalic",{ 109 0x1D6F6: [668,0,567,28,687] // MATHEMATICAL ITALIC CAPITAL UPSILON 110 }); 111 112 UPDATE("General/Regular/LatinExtendedD",{},[0xA792]); 113 114 UPDATE("General/Regular/LetterlikeSymbols",{ 115 0x2145: [662,0,722,70,677], // stix-mathematical bold double-struck capital D 116 0x2146: [683,10,574,45,519], // stix-mathematical bold double-struck small letter d 117 0x2147: [460,10,523,45,478], // stix-mathematical bold double-struck small letter e 118 0x2148: [683,0,258,55,203], // stix-mathematical bold double-struck small letter i 119 0x2149: [683,217,305,-15,250] // stix-mathematical bold double-struck small letter j 120 }); 121 122 UPDATE("General/Regular/MathOperators",{ 123 0x22FF: [662,0,560,73,487] // Z NOTATION BAG MEMBERSHIP 124 }); 125 126 UPDATE("General/Regular/MiscMathSymbolsA",{},[0x27CB,0x27CD]); 127 128 UPDATE("General/Regular/MiscSymbols",{},[0x26E2]); 129 130 UPDATE("General/Regular/MiscTechnical",{ 131 0x23DC: [55,152,556,-10,566], // TOP PARENTHESIS (mathematical use) 132 0x23DD: [771,-564,556,-10,566], // BOTTOM PARENTHESIS (mathematical use) 133 0x23DE: [117,88,556,-10,566], // TOP CURLY BRACKET (mathematical use) 134 0x23DF: [769,-564,556,-10,566], // BOTTOM CURLY BRACKET (mathematical use) 135 0x23E0: [66,212,926,-3,929], // TOP TORTOISE SHELL BRACKET (mathematical use) 136 0x23E1: [842,-564,926,-3,929] // BOTTOM TORTOISE SHELL BRACKET (mathematical use) 137 }); 138 139 UPDATE("General/Regular/PhoneticExtensions",{},[0x1D98,0x1DA3]); 140 141 UPDATE("General/Regular/SpacingModLetters",{},[0x2F7]); 142 143 UPDATE("General/Regular/SuppMathOperators",{},[0x2AFC,0x2AFF]); 144 145 UPDATE("NonUnicode/Bold/PrivateUse",{ 146 0xE060: [-137,322,0,0,330], // stix-double underbar 147 0xE0A1: [691,19,769,27,734], // stix-capital C with stroke 148 0xE38A: [676,0,787,50,737], // stix-mathematical bold double-struck capital A 149 0xE38B: [676,0,729,75,669], // stix-mathematical bold double-struck capital B 150 0xE38D: [676,0,650,75,595], // stix-mathematical bold double-struck capital E 151 0xE38E: [676,0,474,75,595], // stix-mathematical bold double-struck capital F 152 0xE38F: [691,19,751,45,686], // stix-mathematical bold double-struck capital G 153 0xE390: [676,0,380,80,300], // stix-mathematical bold double-struck capital I 154 0xE391: [676,19,618,50,548], // stix-mathematical bold double-struck capital J 155 0xE392: [676,0,792,75,767], // stix-mathematical bold double-struck capital K 156 0xE393: [676,0,662,70,607], // stix-mathematical bold double-struck capital L 157 0xE394: [676,0,914,75,839], // stix-mathematical bold double-struck capital M 158 0xE395: [691,19,787,45,742], // stix-mathematical bold double-struck capital O 159 0xE396: [692,19,702,45,657], // stix-mathematical bold double-struck capital S 160 0xE397: [676,0,556,25,645], // stix-mathematical bold double-struck capital T 161 0xE398: [676,19,738,70,668], // stix-mathematical bold double-struck capital U 162 0xE399: [676,0,627,17,704], // stix-mathematical bold double-struck capital V 163 0xE39A: [676,0,996,17,1015], // stix-mathematical bold double-struck capital W 164 0xE39B: [676,0,794,20,769], // stix-mathematical bold double-struck capital X 165 0xE39C: [676,0,652,23,739], // stix-mathematical bold double-struck capital Y 166 0xE39D: [473,14,623,50,563], // stix-mathematical bold double-struck small letter a 167 0xE39E: [676,14,643,60,593], // stix-mathematical bold double-struck small letter b 168 0xE39F: [473,14,574,50,524], // stix-mathematical bold double-struck small letter c 169 0xE3A2: [676,0,474,25,536], // stix-mathematical bold double-struck small letter f 170 0xE3A3: [473,205,643,50,583], // stix-mathematical bold double-struck small letter g 171 0xE3A4: [676,0,624,60,564], // stix-mathematical bold double-struck small letter h 172 0xE3A7: [676,0,646,60,621], // stix-mathematical bold double-struck small letter k 173 0xE3A8: [676,0,325,60,265], // stix-mathematical bold double-struck small letter l 174 0xE3A9: [473,0,908,60,848], // stix-mathematical bold double-struck small letter m 175 0xE3AA: [473,0,624,60,564], // stix-mathematical bold double-struck small letter n 176 0xE3AB: [473,14,598,45,553], // stix-mathematical bold double-struck small letter o 177 0xE3AC: [473,205,643,60,593], // stix-mathematical bold double-struck small letter p 178 0xE3AD: [473,205,643,50,583], // stix-mathematical bold double-struck small letter q 179 0xE3AE: [473,0,339,60,445], // stix-mathematical bold double-struck small letter r 180 0xE3AF: [473,14,549,52,497], // stix-mathematical bold double-struck small letter s 181 0xE3B0: [676,14,446,25,411], // stix-mathematical bold double-struck small letter t 182 0xE3B1: [461,16,619,55,559], // stix-mathematical bold double-struck small letter u 183 0xE3B2: [461,0,494,6,544], // stix-mathematical bold double-struck small letter v 184 0xE3B3: [461,0,786,22,789], // stix-mathematical bold double-struck small letter w 185 0xE3B4: [461,0,660,25,635], // stix-mathematical bold double-struck small letter x 186 0xE3B5: [461,205,471,-9,537], // stix-mathematical bold double-struck small letter y 187 0xE3B6: [461,0,513,40,473] // stix-mathematical bold double-struck small letter z 188 }); 189 190 UPDATE("NonUnicode/BoldItalic/PrivateUse",{ 191 0xE388: [707,14,598,18,563] // stix-small Greek lambda with straight bar through it 192 }); 193 194 UPDATE("NonUnicode/Italic/PrivateUse",{ 195 0xE387: [683,10,557,52,526] // stix-small Greek lambda with straight bar through it 196 }); 197 198 UPDATE("NonUnicode/Regular/PrivateUse",{ 199 0xE041: [911,-433,480,64,398], // stix-modifier letter small h turned, superscript 200 0xE042: [755,-425,441,57,387], // stix-modifier letter small a (one-story) turned, superscript 201 0xE060: [-140,292,1,11,323], // stix-double underbar 202 0xE09F: [662,156,902,0,863], // stix-rising diagonal 203 0xE0A0: [662,156,902,0,863], // stix-falling diagonal 204 0xE0A1: [676,14,734,18,700], // stix-capital C with stroke 205 0xE0E4: [773,80,700,94,606] // stix-Uranus 206 }); 207 208 UPDATE("SizeTwoSym/Regular/All",{},[0x2AFF]); 209 210 MathJax.Ajax.loadComplete(HTMLCSS.fontDir+"/fontdata-1.0.js"); 211 212 })(MathJax.OutputJax["HTML-CSS"],MathJax.Hub); 213