File:
[LON-CAPA] /
loncom /
html /
adm /
jsMath /
jsMath-BaKoMa-fonts.js
Revision
1.3:
download - view:
text,
annotated -
select for diffs
Tue Oct 9 21:29:16 2007 UTC (17 years, 1 month ago) by
albertel
Branches:
MAIN
CVS tags:
version_2_9_X,
version_2_9_99_0,
version_2_9_1,
version_2_9_0,
version_2_8_X,
version_2_8_99_1,
version_2_8_99_0,
version_2_8_2,
version_2_8_1,
version_2_8_0,
version_2_7_X,
version_2_7_99_1,
version_2_7_99_0,
version_2_7_1,
version_2_7_0,
version_2_6_X,
version_2_6_99_1,
version_2_6_99_0,
version_2_6_3,
version_2_6_2,
version_2_6_1,
version_2_6_0,
version_2_5_99_1,
version_2_5_99_0,
version_2_12_X,
version_2_11_X,
version_2_11_5_msu,
version_2_11_5,
version_2_11_4_uiuc,
version_2_11_4_msu,
version_2_11_4,
version_2_11_3_uiuc,
version_2_11_3_msu,
version_2_11_3,
version_2_11_2_uiuc,
version_2_11_2_msu,
version_2_11_2_educog,
version_2_11_2,
version_2_11_1,
version_2_11_0_RC3,
version_2_11_0_RC2,
version_2_11_0_RC1,
version_2_11_0,
version_2_10_X,
version_2_10_1,
version_2_10_0_RC2,
version_2_10_0_RC1,
version_2_10_0,
loncapaMITrelate_1,
language_hyphenation_merge,
language_hyphenation,
bz6209-base,
bz6209,
bz5969,
bz2851,
PRINT_INCOMPLETE_base,
PRINT_INCOMPLETE,
HEAD,
GCI_3,
GCI_2,
GCI_1,
BZ5971-printing-apage,
BZ5434-fox,
BZ4492-merge,
BZ4492-feature_horizontal_radioresponse
- jsMath 3.4e
/*
* 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: '<i>&kappa</i>', 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: '<span style="font-size: 80%"></span>'}},
cmti10: {'10': {c: '<i>Ω</i>', tclass: 'normal'}},
cmbx10: {'10': {c: '<b>Ω</b>', 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: '<i>Ω</i>', tclass: 'normal'},
'126': {c: '~<span style="margin-left:.1em"></span>'}
},
cmsy10: {
'10': {c: '⊗', tclass: 'arial'},
'55': {c: '<span style="margin-right:-.54em">7</span>'}
},
cmex10: {'10': {c: '<span style="font-size: 67%">D</span>'}},
cmti10: {'10': {c: '<i>Ω</i>', tclass: 'normal'}},
cmbx10: {'10': {c: '<b>Ω</b>', tclass: 'normal'}}
});
} else {
/*
* MSIE/Mac
*/
jsMath.Update.TeXfonts({
cmr10: {
'3': {c: '<font face="Symbol">L</font>', tclass: 'normal'},
'5': {c: '<font face="Symbol">P</font>', tclass: 'normal'},
'10': {c: '<font face="Symbol">W</font>', 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: '<font face="Symbol">L</font>', tclass: 'italic'},
'5': {c: '<font face="Symbol">P</font>', tclass: 'italic'},
'10': {c: '<font face="Symbol">W</font>', tclass: 'italic'},
'15': {c: '<font face="Symbol">e</font>', tclass: 'italic'},
'16': {c: '<font face="Symbol">z</font>', tclass: 'italic'},
'20': {c: '<font face="Symbol">k</font>', tclass: 'italic'},
'22': {c: '<font face="Symbol">m</font>', tclass: 'italic'},
'25': {c: '<font face="Symbol">p</font>', tclass: 'italic'},
'26': {c: '<font face="Symbol">r</font>', tclass: 'italic'},
'27': {c: '<font face="Symbol">s</font>', tclass: 'italic'}
},
cmsy10: {
'3': {c: '<span style="vertical-align:-.3em">*</span>', 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: '<font face="Symbol">Ì</font>', tclass: 'normal'},
'27': {c: '<font face="Symbol">É</font>', tclass: 'normal'}
},
cmex10: {
'3': {c: '<span style="font-size: 67%">i</span>'},
'5': {c: '<span style="font-size: 67%">k</span>'},
'10': {c: '<span style="font-size: 67%">D</span>'},
'15': {c: '<span style="font-size: 55%">Â</span>'},
'16': {c: '<span style="font-size: 83%">µ</span>'},
'20': {c: '<span style="font-size: 83%">"</span>'},
'22': {c: '<span style="font-size: 83%">$</span>'},
'25': {c: '<span style="font-size: 83%">\'</span>'},
'26': {c: '<span style="font-size: 83%">(</span>'},
'27': {c: '<span style="font-size: 83%">)</span>'}
},
cmti10: {
'3': {c: '<font face="Symbol">L</font>', tclass: 'italic'},
'5': {c: '<font face="Symbol">P</font>', tclass: 'italic'},
'10': {c: '<font face="Symbol">W</font>', 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: '<font face="Symbol">L</font>', tclass: 'bold'},
'5': {c: '<font face="Symbol">P</font>', tclass: 'bold'},
'10': {c: '<font face="Symbol">W</font>', 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: '<i>Ω</i>', tclass: 'normal'}},
cmsy10: {'10': {c: '⊗', tclass: 'normal'}},
cmex10: {'10': {c: '<span style="font-size: 67%">D</span>'}},
cmti10: {'10': {c: '<i>Ω</i>', tclass: 'normal'}},
cmbx10: {'10': {c: '<b>Ω</b>', tclass: 'normal'}}
});
}
break;
case "Opera":
jsMath.Update.TeXfonts({
cmr10: {
'10': {c: 'Ω', tclass: 'normal'},
'20': {c: 'ˇ', tclass: 'normal'}
},
cmmi10: {
'10': {c: '<i>Ω</i>', tclass: 'normal'},
'20': {c: 'κ', tclass: 'normal'}
},
cmsy10: {
'10': {c: '⊗', tclass: 'normal'},
'20': {c: '≤', tclass: 'normal'}
},
cmex10: {
'10': {c: '<span style="font-size: 67%">D</span>'},
'20': {c: '<span style="font-size: 82%">"</span>'}
},
cmti10: {
'10': {c: '<i>Ω</i>', tclass: 'normal'},
'20': {c: '<i>ˇ</i>', tclass: 'normal'}
},
cmbx10: {
'10': {c: '<b>Ω</b>', tclass: 'normal'},
'20': {c: '<b>ˇ</b>', 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: '<span style="font-size: 84%">"</span>'}},
cmti10: {'20': {c: '<i>ˇ</i>', tclass: 'normal'}},
cmbx10: {'20': {c: '<b>ˇ</b>', 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'"
});
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>