Annotation of loncom/html/adm/jsMath/jsMath-BaKoMa-fonts.js, revision 1.1
1.1 ! albertel 1: /*
! 2: * jsMath-BaKoMa-fonts.js
! 3: *
! 4: * Part of the jsMath package for mathematics on the web.
! 5: *
! 6: * This file makes changes needed to use the BaKoMa fonts and
! 7: * their encoding.
! 8: *
! 9: * ---------------------------------------------------------------------
! 10: *
! 11: * Copyright 2004-2006 by Davide P. Cervone
! 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:
! 26:
! 27:
! 28: /********************************************************************
! 29: *
! 30: * The BaKoMa fonts have a different encoding, so change the characters
! 31: * to correspond to the their encoding.
! 32: */
! 33:
! 34: jsMath.Script.Start();
! 35:
! 36: if (jsMath.browser == "Mozilla" && navigator.platform != "MacPPC") {
! 37:
! 38: /*
! 39: * Mozilla/PC
! 40: */
! 41: jsMath.Update.TeXfontCodes({
! 42: cmr10: [
! 43: 'Γ', 'Δ', 'Θ', 'Λ',
! 44: 'Ξ', 'Π', 'Σ', 'Υ',
! 45: 'Φ', 'Ψ', 'Ω', 'ff',
! 46: 'fi', 'fl', 'ffi', 'ffl',
! 47:
! 48: 'ı', '', '̀', '́',
! 49: '̌', '̆', '̅', '̊',
! 50: '̧', 'ß', 'æ', 'œ',
! 51: 'ø', 'Æ', 'Œ', 'Ø',
! 52:
! 53: '̷', '!', '”', '#',
! 54: '$', '%', '&', ''',
! 55: '(', ')', '*', '+',
! 56: ',', '-', '.', '/',
! 57:
! 58: '0', '1', '2', '3', '4', '5', '6', '7',
! 59: '8', '9', ':', ';', '¡', '=', '¿', '?',
! 60:
! 61: '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
! 62: 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
! 63:
! 64: 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
! 65: 'X', 'Y', 'Z', '[', '“', ']', '̂', '̇',
! 66:
! 67: '‘', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
! 68: 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
! 69:
! 70: 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
! 71: 'x', 'y', 'z', '–', '—', '̋', '̃', '̈'
! 72: ],
! 73:
! 74: cmmi10: [
! 75: 'Γ', 'Δ', 'Θ', 'Λ',
! 76: 'Ξ', 'Π', 'Σ', 'Υ',
! 77: 'Φ', 'Ψ', 'Ω', 'α',
! 78: 'β', 'γ', 'δ', 'ε',
! 79:
! 80: 'ζ', 'η', 'θ', 'ι',
! 81: 'κ', 'λ', 'μ', 'ν',
! 82: 'ξ', 'π', 'ρ', 'σ',
! 83: 'τ', 'υ', 'φ', 'χ',
! 84:
! 85: 'ψ', 'ω', 'ɛ', 'ϑ',
! 86: 'ϖ', 'ϱ', 'ς', 'ϕ',
! 87: '↼', '↽', '⇀', '⇁',
! 88: '', '', '▹', '◃',
! 89:
! 90: '0', '1', '2', '3', '4', '5', '6', '7',
! 91: '8', '9', '.', ',', '<', '/', '>', '⋆',
! 92:
! 93: '∂', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
! 94: 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
! 95:
! 96: 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
! 97: 'X', 'Y', 'Z', '♭', '♮', '♯', '⌣', '⌢',
! 98:
! 99: 'ℓ', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
! 100: 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
! 101:
! 102: 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
! 103: 'x', 'y', 'z', 'ı', '', '℘', '⃗', '̑'
! 104: ],
! 105:
! 106: cmsy10: [
! 107: '−', '·', '×', '⋆',
! 108: '÷', '⋄', '±', '∓',
! 109: '⊕', '⊖', '⊗', '⊘',
! 110: '⊙', '○', '∘', '∙',
! 111:
! 112: '≃', '≍', '⊆', '⊇',
! 113: '≤', '≥', '≼', '≽',
! 114: '∼', '≅', '⊂', '⊃',
! 115: '≪', '≫', '≺', '≻',
! 116:
! 117: '←', '→', '↑', '↓',
! 118: '↔', '↗', '↘', '≂',
! 119: '⇐', '⇒', '⇑', '⇓',
! 120: '⇔', '↖', '↙', '∝',
! 121:
! 122: '′', '∞', '∈', '∋',
! 123: '△', '▽', '̸', '',
! 124: '∀', '∃', '¬', '∅',
! 125: 'ℜ', 'ℑ', '⊤', '⊥',
! 126:
! 127: 'ℵ', '', 'ℬ', '',
! 128: '', 'ℰ', 'ℱ', '',
! 129: 'ℋ', 'ℐ', '', '',
! 130: 'ℒ', 'ℳ', '', '',
! 131:
! 132: '', '', 'ℛ', '',
! 133: '', '', '', '',
! 134: '', '', '', '∪',
! 135: '∩', '⊎', '∧', '∨',
! 136:
! 137: '⊢', '⊣', '⌊', '⌋',
! 138: '⌈', '⌉', '{', '}',
! 139: '〈', '〉', '∣', '∥',
! 140: '↕', '⇕', '∖', '≀',
! 141:
! 142: '√', '∐', '∇', '∫',
! 143: '⊔', '⊓', '⊑', '⊒',
! 144: '§', '†', '‡', '¶',
! 145: '♣', '♢', '♡', '♠'
! 146: ],
! 147:
! 148: cmex10: [
! 149: '', '', '', '',
! 150: '', '', '', '',
! 151: '', '', '', '',
! 152: '', '', '', '',
! 153:
! 154: '', '', '', '',
! 155: '', '', '', '',
! 156: '', '', '', '',
! 157: '', '', '', '',
! 158:
! 159: '', '', '', '',
! 160: '', '', '', '',
! 161: '', '', '', '',
! 162: '', '', '', '',
! 163:
! 164: '', '', '', '',
! 165: '', '', '', '',
! 166: '', '', '', '',
! 167: '', '', '', '',
! 168:
! 169: '', '', '', '',
! 170: '', '', '', '',
! 171: '', '', '', '',
! 172: '', '', '', '',
! 173:
! 174: '', '', '', '',
! 175: '', '', '', '',
! 176: '', '', '', '',
! 177: '', '', '', '',
! 178:
! 179: '', '', '', '',
! 180: '', '', '', '',
! 181: '', '', '', '',
! 182: '', '', '', '',
! 183:
! 184: '', '', '', '',
! 185: '', '', '', '',
! 186: '', '', '', '',
! 187: '', '', '', ''
! 188: ]
! 189: });
! 190:
! 191: /*
! 192: * Adjust a few other characters as well
! 193: */
! 194:
! 195: jsMath.Update.TeXfonts({
! 196: cmr10: {'20': {c: 'ˇ', tclass: 'normal', w: .3}},
! 197: cmmi10: {
! 198: '20': {c: '<i>&kappa</i>', tclass: 'normal'},
! 199: '58': {c: '.', tclass: 'normal'},
! 200: '59': {c: ',', tclass: 'normal'},
! 201: '61': {c: '/', tclass: 'cmr10'}
! 202: },
! 203: cmsy10: {
! 204: '3': {c: '*', tclass: 'normal'},
! 205: '16': {c: '≍'},
! 206: '17': {c: '≡', tclass: 'normal'},
! 207: '25': {c: '≈', tclass: 'normal'},
! 208: '39': {c: '≃'},
! 209: '20': {c: '≤', tclass: 'normal'}
! 210: },
! 211: cmex10: {'20': {c: '<span style="font-size: 80%"></span>'}},
! 212: cmti10: {'10': {c: '<i>Ω</i>', tclass: 'normal'}},
! 213: cmbx10: {'10': {c: '<b>Ω</b>', tclass: 'normal'}}
! 214: });
! 215:
! 216: } else {
! 217:
! 218: jsMath.Font.BaKoMa = [
! 219: '¡', '¢', '£', '¤', '¥', '¦', '§', '¨',
! 220: '©', 'ª', '­', '®', '¯', '°', '±', '²',
! 221:
! 222: '³', '´', 'µ', '¶', '∙', '¸', '¹', 'º',
! 223: '»', '¼', '½', '¾', '¿', 'À', 'Á', 'Â',
! 224:
! 225: 'Ã', '!', '"', '#', '$', '%', '&', '\'',
! 226: '(', ')', '*', '+', ',', '-', '.', '/',
! 227:
! 228: '0', '1', '2', '3', '4', '5', '6', '7',
! 229: '8', '9', ':', ';', '<', '=', '>', '?',
! 230:
! 231: '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
! 232: 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
! 233:
! 234: 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
! 235: 'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
! 236:
! 237: '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
! 238: 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
! 239:
! 240: 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
! 241: 'x', 'y', 'z', '{', '|', '}', '~', 'Ä'
! 242: ];
! 243:
! 244: jsMath.Update.TeXfontCodes({
! 245: cmr10: jsMath.Font.BaKoMa,
! 246: cmmi10: jsMath.Font.BaKoMa,
! 247: cmsy10: jsMath.Font.BaKoMa,
! 248: cmex10: jsMath.Font.BaKoMa,
! 249: cmti10: jsMath.Font.BaKoMa,
! 250: cmbx10: jsMath.Font.BaKoMa
! 251: });
! 252:
! 253: /*
! 254: * MSIE corrections
! 255: */
! 256: switch (jsMath.browser) {
! 257:
! 258: case "MSIE":
! 259: if (navigator.platform == "Win32") {
! 260: /*
! 261: * MSIE/PC
! 262: */
! 263: jsMath.Browser.msieFontBug = 1;
! 264: jsMath.Update.TeXfonts({
! 265: cmr10: {'10': {c: 'Ω', tclass: 'normal'}},
! 266: cmmi10: {
! 267: '10': {c: '<i>Ω</i>', tclass: 'normal'},
! 268: '126': {c: '~<span style="margin-left:.1em"></span>'}
! 269: },
! 270: cmsy10: {
! 271: '10': {c: '⊗', tclass: 'arial'},
! 272: '55': {c: '<span style="margin-right:-.54em">7</span>'}
! 273: },
! 274: cmex10: {'10': {c: '<span style="font-size: 67%">D</span>'}},
! 275: cmti10: {'10': {c: '<i>Ω</i>', tclass: 'normal'}},
! 276: cmbx10: {'10': {c: '<b>Ω</b>', tclass: 'normal'}}
! 277: });
! 278: } else {
! 279: /*
! 280: * MSIE/Mac
! 281: */
! 282: jsMath.Update.TeXfonts({
! 283:
! 284: cmr10: {
! 285: '3': {c: '<font face="Symbol">L</font>', tclass: 'normal'},
! 286: '5': {c: '<font face="Symbol">P</font>', tclass: 'normal'},
! 287: '10': {c: '<font face="Symbol">W</font>', tclass: 'normal'},
! 288: '15': {c: 'ffl', tclass: 'normal'},
! 289: '16': {c: 'ı', tclass: 'normal'},
! 290: '20': {c: 'ˇ', tclass: 'normal'},
! 291: '22': {c: '¯', tclass: 'normal', w: .3},
! 292: '25': {c: 'ß', tclass: 'normal'},
! 293: '26': {c: 'æ', tclass: 'normal'},
! 294: '27': {c: 'œ', tclass: 'normal'}
! 295: },
! 296:
! 297: cmmi10: {
! 298: '3': {c: '<font face="Symbol">L</font>', tclass: 'italic'},
! 299: '5': {c: '<font face="Symbol">P</font>', tclass: 'italic'},
! 300: '10': {c: '<font face="Symbol">W</font>', tclass: 'italic'},
! 301: '15': {c: '<font face="Symbol">e</font>', tclass: 'italic'},
! 302: '16': {c: '<font face="Symbol">z</font>', tclass: 'italic'},
! 303: '20': {c: '<font face="Symbol">k</font>', tclass: 'italic'},
! 304: '22': {c: '<font face="Symbol">m</font>', tclass: 'italic'},
! 305: '25': {c: '<font face="Symbol">p</font>', tclass: 'italic'},
! 306: '26': {c: '<font face="Symbol">r</font>', tclass: 'italic'},
! 307: '27': {c: '<font face="Symbol">s</font>', tclass: 'italic'}
! 308: },
! 309:
! 310: cmsy10: {
! 311: '3': {c: '<span style="vertical-align:-.3em">*</span>', tclass: 'normal'},
! 312: '5': {c: 'Ή', tclass: 'normal'},
! 313: '10': {c: '⊗', tclass: 'normal'},
! 314: '15': {c: '•', tclass: 'normal'},
! 315: '16': {c: '≍', tclass: 'normal'},
! 316: '20': {c: '≤', tclass: 'normal'},
! 317: '22': {c: '≤', tclass: 'normal'},
! 318: '25': {c: '≈', tclass: 'normal'},
! 319: '26': {c: '<font face="Symbol">Ì</font>', tclass: 'normal'},
! 320: '27': {c: '<font face="Symbol">É</font>', tclass: 'normal'}
! 321: },
! 322:
! 323: cmex10: {
! 324: '3': {c: '<span style="font-size: 67%">i</span>'},
! 325: '5': {c: '<span style="font-size: 67%">k</span>'},
! 326: '10': {c: '<span style="font-size: 67%">D</span>'},
! 327: '15': {c: '<span style="font-size: 55%">Â</span>'},
! 328: '16': {c: '<span style="font-size: 83%">µ</span>'},
! 329: '20': {c: '<span style="font-size: 83%">"</span>'},
! 330: '22': {c: '<span style="font-size: 83%">$</span>'},
! 331: '25': {c: '<span style="font-size: 83%">\'</span>'},
! 332: '26': {c: '<span style="font-size: 83%">(</span>'},
! 333: '27': {c: '<span style="font-size: 83%">)</span>'}
! 334: },
! 335:
! 336: cmti10: {
! 337: '3': {c: '<font face="Symbol">L</font>', tclass: 'italic'},
! 338: '5': {c: '<font face="Symbol">P</font>', tclass: 'italic'},
! 339: '10': {c: '<font face="Symbol">W</font>', tclass: 'italic'},
! 340: '16': {c: 'ı', tclass: 'italic'},
! 341: '20': {c: '­', tclass: 'italic'},
! 342: '22': {c: '¯', tclass: 'italic', w: .3},
! 343: '25': {c: 'ß', tclass: 'italic'},
! 344: '26': {c: 'æ', tclass: 'italic'},
! 345: '27': {c: 'œ', tclass: 'italic'}
! 346: },
! 347:
! 348: cmbx10: {
! 349: '3': {c: '<font face="Symbol">L</font>', tclass: 'bold'},
! 350: '5': {c: '<font face="Symbol">P</font>', tclass: 'bold'},
! 351: '10': {c: '<font face="Symbol">W</font>', tclass: 'bold'},
! 352: '16': {c: 'ı', tclass: 'bold'},
! 353: '20': {c: '­', tclass: 'bold'},
! 354: '22': {c: '¯', tclass: 'bold', w: .3},
! 355: '25': {c: 'ß', tclass: 'bold'},
! 356: '26': {c: 'æ', tclass: 'bold'},
! 357: '27': {c: 'œ', tclass: 'bold'}
! 358: }
! 359: });
! 360: }
! 361: break;
! 362:
! 363: case "Mozilla":
! 364: if (navigator.platform == "MacPPC") {
! 365: /*
! 366: * Mozilla/Mac
! 367: */
! 368: jsMath.Update.TeXfonts({
! 369: cmr10: {'10': {c: 'Ω', tclass: 'normal'}},
! 370: cmmi10: {'10': {c: '<i>Ω</i>', tclass: 'normal'}},
! 371: cmsy10: {'10': {c: '⊗', tclass: 'normal'}},
! 372: cmex10: {'10': {c: '<span style="font-size: 67%">D</span>'}},
! 373: cmti10: {'10': {c: '<i>Ω</i>', tclass: 'normal'}},
! 374: cmbx10: {'10': {c: '<b>Ω</b>', tclass: 'normal'}}
! 375: });
! 376: }
! 377: break;
! 378:
! 379: case "Opera":
! 380: jsMath.Update.TeXfonts({
! 381: cmr10: {
! 382: '10': {c: 'Ω', tclass: 'normal'},
! 383: '20': {c: 'ˇ', tclass: 'normal'}
! 384: },
! 385: cmmi10: {
! 386: '10': {c: '<i>Ω</i>', tclass: 'normal'},
! 387: '20': {c: 'κ', tclass: 'normal'}
! 388: },
! 389: cmsy10: {
! 390: '10': {c: '⊗', tclass: 'normal'},
! 391: '20': {c: '≤', tclass: 'normal'}
! 392: },
! 393: cmex10: {
! 394: '10': {c: '<span style="font-size: 67%">D</span>'},
! 395: '20': {c: '<span style="font-size: 82%">"</span>'}
! 396: },
! 397: cmti10: {
! 398: '10': {c: '<i>Ω</i>', tclass: 'normal'},
! 399: '20': {c: '<i>ˇ</i>', tclass: 'normal'}
! 400: },
! 401: cmbx10: {
! 402: '10': {c: '<b>Ω</b>', tclass: 'normal'},
! 403: '20': {c: '<b>ˇ</b>', tclass: 'normal'}
! 404: }
! 405: });
! 406: break;
! 407:
! 408: case "Konqueror":
! 409: jsMath.Update.TeXfonts({
! 410: cmr10: {'20': {c: 'ˇ', tclass: 'normal'}},
! 411: cmmi10: {'20': {c: 'κ', tclass: 'normal'}},
! 412: cmsy10: {'20': {c: '≤', tclass: 'normal'}},
! 413: cmex10: {'20': {c: '<span style="font-size: 84%">"</span>'}},
! 414: cmti10: {'20': {c: '<i>ˇ</i>', tclass: 'normal'}},
! 415: cmbx10: {'20': {c: '<b>ˇ</b>', tclass: 'normal'}}
! 416: });
! 417: break;
! 418: }
! 419:
! 420: }
! 421:
! 422: jsMath.Setup.Styles({
! 423: '.typeset .cmr10': 'font-family: cmr10, serif',
! 424: '.typeset .cmbx10': 'font-family: cmbx10, cmr10',
! 425: '.typeset .cmti10': 'font-family: cmti10, cmr10',
! 426: '.typeset .cmmi10': 'font-family: cmmi10',
! 427: '.typeset .cmsy10': 'font-family: cmsy10',
! 428: '.typeset .cmex10': 'font-family: cmex10',
! 429: '.typeset .arial': "font-family: 'Arial unicode MS'"
! 430: });
! 431:
! 432: jsMath.Script.End();
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>