> I don't know what is the purpose of MathJax_Caligraphic,
> MathJax_WinChrome, MathJax_WinIE6?
MathJax_Caligraphic is for the TeX \cal font (for which there is no
equivalent in MathML).
MathJax_WinChrome and MathJax_WinIE6 include characters that were not
accessible in those browsers. I should look at Chrome again and see
if that has been improved since I first set up the fonts (there were
only five or six anyway). IE6 had quite a few that it couldn't access.
> I suppose MathJax_Size* fonts are used to construct stretchy
> characters.
MathJax_Size4 contains the partial characters for making stretchy
delimiters (e.g., U+239B through U+23A0). MathJax_Size1 contains the
first size (larger than standard text) of the delimiters,
MathJax_Size2 contains the next larger size, and so on.
> Mozilla can not currently read Open type MATH tables (and I can't
> find them in the MathJax fonts anyway),
MathJax can't access any of the internal font data (JavaScript doesn't
have access to that), so the fonts fon't contain anything like that.
(In any case, I am not a font expert and don't know how to make them
anyway).
> so I have to write (or hopefully generate) some tables in Mozilla's
> own format. Can you please indicate me where those tables are stored
> in MathJax and which format is used? Thanks.
The only data about the fonts is in the unpacked/jax/output/HTML-CSS/
fonts/TeX/fontdata.js file It is in JavaScript objects that are not
in any standard format (they are MathJax internal data). There is a
delimiter array that lists the various sizes available for the
stretchy characters, together with the parts to mark arbitrary sized
ones, when available. You might be able to use that, though it may
not be immediately obvious what everything is. If you want to go that
route, I can try to map it out better for you.
Davide
> MathJax_Caligraphic is for the TeX \cal font (for which there is no
> equivalent in MathML).
>
> MathJax_WinChrome and MathJax_WinIE6 include characters that were not
> accessible in those browsers. I should look at Chrome again and see
> if that has been improved since I first set up the fonts (there were
> only five or six anyway). IE6 had quite a few that it couldn't access.
OK, so they are probably not needed for my purpose.
> The only data about the fonts is in the
> unpacked/jax/output/HTML-CSS/fonts/TeX/fontdata.js file It is in
> JavaScript objects that are not in any standard format (they are
> MathJax internal data). There is a delimiter array that lists the
> various sizes available for the stretchy characters, together with the
> parts to mark arbitrary sized ones, when available. You might be able
> to use that, though it may not be immediately obvious what everything
> is. If you want to go that route, I can try to map it out better for
> you.
Thank you. In Mozilla the stretchy characters are described that way:
- Top/Left glyph
- Middle glyph
- Bottom Right glyph
- Glue glyph: the one which is repeated to connect the three other
components.
- size0
- size1
- ...
- sizeN
So if I'm trying to guess what the DELIMITERS array is:
- dir is the direction vertical/horizontal (in Mozilla, this is already
stored in the operator dictionary)
- HW: I guess it is some kind of factor to decide which font should be
used with respect to the size we want to stretch? (in Mozilla we can
measure directly the size of the glyphs in fonts, so this is probably
not needed)
- stretch: I can see what are top, bot, mid, left and right. What about
ext/sep? Are they "glue" glyphs in Mozilla's terminology?
Right.
>> The only data about the fonts is in the unpacked/jax/output/HTML-
>> CSS/fonts/TeX/fontdata.js file It is in JavaScript objects that
>> are not in any standard format (they are MathJax internal data).
>> There is a delimiter array that lists the various sizes available
>> for the stretchy characters, together with the parts to mark
>> arbitrary sized ones, when available. You might be able to use
>> that, though it may not be immediately obvious what everything is.
>> If you want to go that route, I can try to map it out better for you.
> Thank you. In Mozilla the stretchy characters are described that way:
>
> - Top/Left glyph
> - Middle glyph
> - Bottom Right glyph
> - Glue glyph: the one which is repeated to connect the three other
> components.
> - size0
> - size1
> - ...
> - sizeN
>
> So if I'm trying to guess what the DELIMITERS array is:
>
> - dir is the direction vertical/horizontal (in Mozilla, this is
> already stored in the operator dictionary)
right.
> - HW: I guess it is some kind of factor to decide which font should
> be used with respect to the size we want to stretch? (in Mozilla we
> can measure directly the size of the glyphs in fonts, so this is
> probably not needed)
Actually, this is the list corresponding to the size0,size1,...,sizeN
list at the end of your data. This is an array of arrays, with the
inner arrays having two elements: the height or width of the character
(depending on whether it is stretching vertically or horizontally) and
the font in which the character appears. The fonts are often listed
as variable names (which are defined at the top of the file) to reduce
the size of the file. The character in that font is assumed to be at
the same unicode code point as the delimiter being stretched. In rare
cases, the array has three or four entries, in which case the third is
a scaling factor to be applied to the character, and the fourth is a
unicode position where the character is to be found (in those cases
where it is not at the same location as the delimiter being stretched).
> - stretch: I can see what are top, bot, mid, left and right. What
> about ext/sep? Are they "glue" glyphs in Mozilla's terminology?
Yes, ext is the "extender" for vertical delimiters, and sep is the
"separator" for horizontal ones. They are your glue characters.
These are given by an array that includes the unicode location of the
character and the font in which it is found. Note that in the case of
braces, the mid character is actually made of two separate characters;
Firefox may not be set up do deal with that.
Note that there are more stretchy characters listed in the fontdata-
extra.js file in the v2.0-candidate branch.
Davide
There are actaully only two sizes for these characters in most cases.
When an operator is in displaystyle, MathJax looks first in
MathJax_Size2, then in MathJax_Size1, then in MathJax_Main for the
operator. If it is not in displaystyle, then it only looks in
MathJax_Size1 and MathJax_Main. The fonts searched are listed in the
VARIANTS array in the "-largeop" and "-smallop" entries.
Davide
Davide
Actually, this is the list corresponding to the size0,size1,...,sizeN list at the end of your data. This is an array of arrays, with the inner arrays having two elements: the height or width of the character (depending on whether it is stretching vertically or horizontally) and the font in which the character appears. The fonts are often listed as variable names (which are defined at the top of the file) to reduce the size of the file. The character in that font is assumed to be at the same unicode code point as the delimiter being stretched. In rare cases, the array has three or four entries, in which case the third is a scaling factor to be applied to the character, and the fourth is a unicode position where the character is to be found (in those cases where it is not at the same location as the delimiter being stretched).
Note that in the case of braces, the mid character is actually made of two separate characters; Firefox may not be set up do deal with that.
Note that there are more stretchy characters listed in the fontdata-extra.js file in the v2.0-candidate branch.Yes, I noticed this.
Yes, the FONTDATA.FONTS['MathJax_Size1'] and FONTDATA.FONTS['MathJax_Size2'] arrays should include everything in those fonts (that's not the case for every font, but is for those two).
Davide
This is only rarely used, and I think it is not used in the MathJax
fonts. It was used in the STIX fonts when there were not characters
in sizes that TeX needed. But as I said, it was rare. I just wanted
you to know what it meant if you saw it.
Davide
Just for the record:
https://bugzilla.mozilla.org/show_bug.cgi?id=701758
Davide
0x21A0: // right two-headed arrow
{
dir: H, HW: [[1,AMS]], stretch: {right:[0x221A0,AMS], rep:[0x2212,MAIN]}
},
Here, right should contain 0x21A0 instead of 0x221A0.
Davide
-- Frédéric Wang maths-informatique-jeux.com/blog/frederic