/*
* jsMath-BaKoMa-fonts.js
*
* Part of the jsMath package for mathematics on the web.
*
* This file makes changes needed to use the BaKoMa fonts and
* their encoding.
*
* ---------------------------------------------------------------------
*
* Copyright 2004-2007 by Davide P. Cervone
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/********************************************************************
*
* The BaKoMa fonts have a different encoding, so change the characters
* to correspond to the their encoding.
*/
if (jsMath.browser == "Mozilla" && jsMath.platform != "mac") {
/*
* Mozilla/PC
*/
jsMath.Update.TeXfontCodes({
cmr10: [
'Γ', 'Δ', 'Θ', 'Λ',
'Ξ', 'Π', 'Σ', 'Υ',
'Φ', 'Ψ', 'Ω', 'ff',
'fi', 'fl', 'ffi', 'ffl',
'ı', '', '̀', '́',
'̌', '̆', '̅', '̊',
'̧', 'ß', 'æ', 'œ',
'ø', 'Æ', 'Œ', 'Ø',
'̷', '!', '”', '#',
'$', '%', '&', ''',
'(', ')', '*', '+',
',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', ':', ';', '¡', '=', '¿', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '[', '“', ']', '̂', '̇',
'‘', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '–', '—', '̋', '̃', '̈'
],
cmmi10: [
'Γ', 'Δ', 'Θ', 'Λ',
'Ξ', 'Π', 'Σ', 'Υ',
'Φ', 'Ψ', 'Ω', 'α',
'β', 'γ', 'δ', 'ε',
'ζ', 'η', 'θ', 'ι',
'κ', 'λ', 'μ', 'ν',
'ξ', 'π', 'ρ', 'σ',
'τ', 'υ', 'φ', 'χ',
'ψ', 'ω', 'ɛ', 'ϑ',
'ϖ', 'ϱ', 'ς', 'ϕ',
'↼', '↽', '⇀', '⇁',
'', '', '▹', '◃',
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', '.', ',', '<', '/', '>', '⋆',
'∂', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '♭', '♮', '♯', '⌣', '⌢',
'ℓ', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', 'ı', '', '℘', '⃗', '̑'
],
cmsy10: [
'−', '·', '×', '⋆',
'÷', '⋄', '±', '∓',
'⊕', '⊖', '⊗', '⊘',
'⊙', '○', '∘', '∙',
'≃', '≍', '⊆', '⊇',
'≤', '≥', '≼', '≽',
'∼', '≅', '⊂', '⊃',
'≪', '≫', '≺', '≻',
'←', '→', '↑', '↓',
'↔', '↗', '↘', '≂',
'⇐', '⇒', '⇑', '⇓',
'⇔', '↖', '↙', '∝',
'′', '∞', '∈', '∋',
'△', '▽', '̸', '',
'∀', '∃', '¬', '∅',
'ℜ', 'ℑ', '⊤', '⊥',
'ℵ', '', 'ℬ', '',
'', 'ℰ', 'ℱ', '',
'ℋ', 'ℐ', '', '',
'ℒ', 'ℳ', '', '',
'', '', 'ℛ', '',
'', '', '', '',
'', '', '', '∪',
'∩', '⊎', '∧', '∨',
'⊢', '⊣', '⌊', '⌋',
'⌈', '⌉', '{', '}',
'〈', '〉', '∣', '∥',
'↕', '⇕', '∖', '≀',
'√', '∐', '∇', '∫',
'⊔', '⊓', '⊑', '⊒',
'§', '†', '‡', '¶',
'♣', '♢', '♡', '♠'
],
cmex10: [
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', '',
'', '', '', ''
]
});
/*
* Adjust a few other characters as well
*/
jsMath.Update.TeXfonts({
cmr10: {'20': {c: 'ˇ', tclass: 'normal', w: .3}},
cmmi10: {
'20': {c: '&kappa', tclass: 'normal'},
'58': {c: '.', tclass: 'normal'},
'59': {c: ',', tclass: 'normal'},
'61': {c: '/', tclass: 'cmr10'}
},
cmsy10: {
'3': {c: '*', tclass: 'normal'},
'16': {c: '≍'},
'17': {c: '≡', tclass: 'normal'},
'25': {c: '≈', tclass: 'normal'},
'39': {c: '≃'},
'20': {c: '≤', tclass: 'normal'}
},
cmex10: {'20': {c: ''}},
cmti10: {'10': {c: 'Ω', tclass: 'normal'}},
cmbx10: {'10': {c: 'Ω', tclass: 'normal'}}
});
} else {
jsMath.Font.BaKoMa = [
'¡', '¢', '£', '¤', '¥', '¦', '§', '¨',
'©', 'ª', '', '®', '¯', '°', '±', '²',
'³', '´', 'µ', '¶', '∙', '¸', '¹', 'º',
'»', '¼', '½', '¾', '¿', 'À', 'Á', 'Â',
'Ã', '!', '"', '#', '$', '%', '&', '\'',
'(', ')', '*', '+', ',', '-', '.', '/',
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', ':', ';', '<', '=', '>', '?',
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', '[', '\\', ']', '^', '_',
'`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
'x', 'y', 'z', '{', '|', '}', '~', 'Ä'
];
jsMath.Update.TeXfontCodes({
cmr10: jsMath.Font.BaKoMa,
cmmi10: jsMath.Font.BaKoMa,
cmsy10: jsMath.Font.BaKoMa,
cmex10: jsMath.Font.BaKoMa,
cmti10: jsMath.Font.BaKoMa,
cmbx10: jsMath.Font.BaKoMa
});
/*
* MSIE corrections
*/
switch (jsMath.browser) {
case "MSIE":
if (jsMath.platform == "pc") {
/*
* MSIE/PC
*/
jsMath.Browser.msieFontBug = 1;
jsMath.Update.TeXfonts({
cmr10: {'10': {c: 'Ω', tclass: 'normal'}},
cmmi10: {
'10': {c: 'Ω', tclass: 'normal'},
'126': {c: '~'}
},
cmsy10: {
'10': {c: '⊗', tclass: 'arial'},
'55': {c: '7'}
},
cmex10: {'10': {c: 'D'}},
cmti10: {'10': {c: 'Ω', tclass: 'normal'}},
cmbx10: {'10': {c: 'Ω', tclass: 'normal'}}
});
} else {
/*
* MSIE/Mac
*/
jsMath.Update.TeXfonts({
cmr10: {
'3': {c: 'L', tclass: 'normal'},
'5': {c: 'P', tclass: 'normal'},
'10': {c: 'W', tclass: 'normal'},
'15': {c: 'ffl', tclass: 'normal'},
'16': {c: 'ı', tclass: 'normal'},
'20': {c: 'ˇ', tclass: 'normal'},
'22': {c: '¯', tclass: 'normal', w: .3},
'25': {c: 'ß', tclass: 'normal'},
'26': {c: 'æ', tclass: 'normal'},
'27': {c: 'œ', tclass: 'normal'}
},
cmmi10: {
'3': {c: 'L', tclass: 'italic'},
'5': {c: 'P', tclass: 'italic'},
'10': {c: 'W', tclass: 'italic'},
'15': {c: 'e', tclass: 'italic'},
'16': {c: 'z', tclass: 'italic'},
'20': {c: 'k', tclass: 'italic'},
'22': {c: 'm', tclass: 'italic'},
'25': {c: 'p', tclass: 'italic'},
'26': {c: 'r', tclass: 'italic'},
'27': {c: 's', tclass: 'italic'}
},
cmsy10: {
'3': {c: '*', tclass: 'normal'},
'5': {c: 'Ή', tclass: 'normal'},
'10': {c: '⊗', tclass: 'normal'},
'15': {c: '•', tclass: 'normal'},
'16': {c: '≍', tclass: 'normal'},
'20': {c: '≤', tclass: 'normal'},
'22': {c: '≤', tclass: 'normal'},
'25': {c: '≈', tclass: 'normal'},
'26': {c: 'Ì', tclass: 'normal'},
'27': {c: 'É', tclass: 'normal'}
},
cmex10: {
'3': {c: 'i'},
'5': {c: 'k'},
'10': {c: 'D'},
'15': {c: 'Â'},
'16': {c: 'µ'},
'20': {c: '"'},
'22': {c: '$'},
'25': {c: '\''},
'26': {c: '('},
'27': {c: ')'}
},
cmti10: {
'3': {c: 'L', tclass: 'italic'},
'5': {c: 'P', tclass: 'italic'},
'10': {c: 'W', tclass: 'italic'},
'16': {c: 'ı', tclass: 'italic'},
'20': {c: '', tclass: 'italic'},
'22': {c: '¯', tclass: 'italic', w: .3},
'25': {c: 'ß', tclass: 'italic'},
'26': {c: 'æ', tclass: 'italic'},
'27': {c: 'œ', tclass: 'italic'}
},
cmbx10: {
'3': {c: 'L', tclass: 'bold'},
'5': {c: 'P', tclass: 'bold'},
'10': {c: 'W', tclass: 'bold'},
'16': {c: 'ı', tclass: 'bold'},
'20': {c: '', tclass: 'bold'},
'22': {c: '¯', tclass: 'bold', w: .3},
'25': {c: 'ß', tclass: 'bold'},
'26': {c: 'æ', tclass: 'bold'},
'27': {c: 'œ', tclass: 'bold'}
}
});
}
break;
case "Mozilla":
if (jsMath.platform == "mac") {
/*
* Mozilla/Mac
*/
jsMath.Update.TeXfonts({
cmr10: {'10': {c: 'Ω', tclass: 'normal'}},
cmmi10: {'10': {c: 'Ω', tclass: 'normal'}},
cmsy10: {'10': {c: '⊗', tclass: 'normal'}},
cmex10: {'10': {c: 'D'}},
cmti10: {'10': {c: 'Ω', tclass: 'normal'}},
cmbx10: {'10': {c: 'Ω', tclass: 'normal'}}
});
}
break;
case "Opera":
jsMath.Update.TeXfonts({
cmr10: {
'10': {c: 'Ω', tclass: 'normal'},
'20': {c: 'ˇ', tclass: 'normal'}
},
cmmi10: {
'10': {c: 'Ω', tclass: 'normal'},
'20': {c: 'κ', tclass: 'normal'}
},
cmsy10: {
'10': {c: '⊗', tclass: 'normal'},
'20': {c: '≤', tclass: 'normal'}
},
cmex10: {
'10': {c: 'D'},
'20': {c: '"'}
},
cmti10: {
'10': {c: 'Ω', tclass: 'normal'},
'20': {c: 'ˇ', tclass: 'normal'}
},
cmbx10: {
'10': {c: 'Ω', tclass: 'normal'},
'20': {c: 'ˇ', tclass: 'normal'}
}
});
break;
case "Konqueror":
jsMath.Update.TeXfonts({
cmr10: {'20': {c: 'ˇ', tclass: 'normal'}},
cmmi10: {'20': {c: 'κ', tclass: 'normal'}},
cmsy10: {'20': {c: '≤', tclass: 'normal'}},
cmex10: {'20': {c: '"'}},
cmti10: {'20': {c: 'ˇ', tclass: 'normal'}},
cmbx10: {'20': {c: 'ˇ', tclass: 'normal'}}
});
break;
}
}
jsMath.Setup.Styles({
'.typeset .cmr10': 'font-family: cmr10, serif',
'.typeset .cmbx10': 'font-family: cmbx10, cmr10',
'.typeset .cmti10': 'font-family: cmti10, cmr10',
'.typeset .cmmi10': 'font-family: cmmi10',
'.typeset .cmsy10': 'font-family: cmsy10',
'.typeset .cmex10': 'font-family: cmex10',
'.typeset .arial': "font-family: 'Arial unicode MS'"
});