File:  [LON-CAPA] / loncom / html / adm / jsMath / jsMath-fallback-mac-mozilla.js
Revision 1.3: download - view: text, annotated - select for diffs
Mon Mar 27 19:32:07 2006 UTC (18 years, 4 months ago) by albertel
Branches: MAIN
CVS tags: HEAD
-jsMath 3.2

    1: /*
    2:  *  jsMath-fallback-mac-mozilla.js
    3:  *  
    4:  *  Part of the jsMath package for mathematics on the web.
    5:  *
    6:  *  This file makes changes needed by Mozilla-based browsers on the Mac
    7:  *  for when the TeX fonts are not available.
    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:  *  Fix the default non-TeX-font characters to work with Mozilla
   31:  *
   32:  */
   33: 
   34: jsMath.Script.Start();
   35: 
   36: jsMath.Update.TeXfonts({
   37:   cmmi10: {
   38: //  '41':  // leftharpoondown
   39: //  '43':  // rightharpoondown    
   40:     '44': {c: '<span style="position:relative; top:.15em; margin-right:-.1em; margin-left:-.2em">&#x02D3;</span>'},
   41:     '45': {c: '<span style="position:relative; top:.15em; margin-right:-.1em; margin-left:-.2em">&#x02D2;</span>'},
   42:     '47': {c: '<span style="font-size:60%">&#x25C1;</span>'},
   43: //  '92':  // natural
   44:     '126': {c: '<span style="position:relative; left: .3em; top: -.7em; font-size: 50%">&#x2192;</span>'}
   45:   },
   46: 
   47:   cmsy10: {
   48:     '0':  {c: '&ndash;', tclass: 'normal'},
   49:     '11': {c: '<span style="font-size: 70%">&#x25EF;</span><span style="position:relative; margin-left:-.5em; top:.1em; margin-right:.3em">/</span>', tclass: 'normal'},
   50:     '42': {c: '&#x2963;'}, '43': {c: '&#x2965'},
   51:     '48': {c: '<span style="font-size: 133%; margin-right: -.75em; position: relative; top:.4em">&#x2032;</span>', tclass: 'normal'},
   52:     '93': {c: '&#x222A;<span style="font-size: 50%; margin-left:-1.3em; position: relative; top:-.3em; margin-right:.6em">+</span>'},
   53:     '104': {c: '<span style="position:relative; top:.15em; margin-left:-.6em">&#x3008;</span>'},
   54:     '105': {c: '<span style="position:relative; top:.15em; margin-right:-.6em">&#x3009;</span>'},
   55:     '109': {c: '&#x2963;<span style="position:relative; top:.1em; margin-left:-1em">&#x2965;</span>'}
   56: //, '116':  // sqcup
   57: //  '117':  // sqcap
   58: //  '118':  // sqsubseteq
   59: //  '119':  // sqsupseteq
   60:   },
   61:   
   62:   cmex10: {
   63:     '10': {c: '<span style="position:relative; top:.1em; margin-left:-.6em">&#x3008;</span>'},
   64:     '11': {c: '<span style="position:relative; top:.1em; margin-right:-.6em">&#x3009;</span>'},
   65:     '14': {c: '/'}, '15': {c: '\\'},
   66:     '28': {c: '<span style="position:relative; top:.1em; margin-left:-.6em">&#x3008;</span>'},
   67:     '29': {c: '<span style="position:relative; top:.1em; margin-right:-.6em">&#x3009;</span>'},
   68:     '30': {c: '/'}, '31': {c: '\\'},
   69:     '42': {c: '<span style="position:relative; top:.1em; margin-left:-.6em">&#x3008;</span>'},
   70:     '43': {c: '<span style="position:relative; top:.1em; margin-right:-.6em">&#x3009;</span>'},
   71:     '44': {c: '/'}, '45': {c: '\\'},
   72:     '46': {c: '/'}, '47': {c: '\\'},
   73:     '68': {c: '<span style="position:relative; top:.1em; margin-left:-.6em">&#x3008;</span>'},
   74:     '69': {c: '<span style="position:relative; top:.1em; margin-right:-.6em">&#x3009;</span>'},
   75: //  '70':  // sqcup
   76: //  '71':  // big sqcup
   77:     '72': {ic: .194},  '73': {ic: .444},
   78:     '82': {tclass: 'bigop1cx', ic: .15}, '90': {tclass: 'bigop2cx', ic:.6},
   79:     '85': {c: '&#x222A;<span style="font-size: 50%; margin-left:-1.3em; position: relative; top:-.3em; margin-right:.6em">+</span>'},
   80:     '93': {c: '&#x222A;<span style="font-size: 50%; margin-left:-1.3em; position: relative; top:-.3em; margin-right:.6em">+</span>'}
   81:   }
   82:   
   83: });
   84: 
   85: jsMath.Setup.Styles({
   86:   '.typeset .symbol':   "font-family: Osaka",
   87:   '.typeset .arrow1':   "font-family: Osaka; position: relative; top: .125em; margin: -1px",
   88:   '.typeset .arrow2':   "font-family: AppleGothic; font-size: 100%; position:relative; top: .11em; margin:-1px",
   89:   '.typeset .bigop1':   "font-family: AppleGothic; font-size: 110%; position:relative; top: .9em; margin:-.05em",
   90:   '.typeset .bigop1b':  "font-family: Osaka; font-size: 140%; position: relative; top: .8em; margin:-.1em",
   91:   '.typeset .bigop1c':  "font-family: AppleGothic; font-size: 125%; position:relative; top: .85em; margin:-.3em",
   92:   '.typeset .bigop1cx': "font-family: 'Apple Chancery'; font-size: 125%; position:relative; top: .7em; margin:-.1em",
   93:   '.typeset .bigop2':   "font-family: AppleGothic; font-size: 175%; position:relative; top: .85em; margin:-.1em",
   94:   '.typeset .bigop2b':  "font-family: Osaka; font-size: 200%; position: relative; top: .75em; margin:-.15em",
   95:   '.typeset .bigop2c':  "font-family: AppleGothic; font-size: 300%; position:relative; top: .75em; margin:-.35em",
   96:   '.typeset .bigop2cx': "font-family: 'Apple Chancery'; font-size: 250%; position:relative; top: .7em; margin-left:-.1em; margin-right:-.2em",
   97:   '.typeset .delim1b':  "font-family: Times; font-size: 150%; position:relative; top:.8em; margin:.01em",
   98:   '.typeset .delim2b':  "font-family: Times; font-size: 210%; position:relative; top:.8em; margin:.01em",
   99:   '.typeset .delim3b':  "font-family: Times; font-size: 300%; position:relative; top:.75em; margin:.01em",
  100:   '.typeset .delim4b':  "font-family: Times; font-size: 400%; position:relative; top:.725em; margin:.01em"
  101: });
  102: 
  103: 
  104: /*
  105:  *  replace \not and \joinrel with better dimensions
  106:  */
  107: 
  108: jsMath.Macro('not','\\mathrel{\\rlap{\\kern 3mu/}}');
  109: jsMath.Macro('joinrel','\\mathrel{\\kern-3mu}');
  110: 
  111: 
  112: jsMath.Script.End();

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>