MathML:OperatorDictionary: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(operator dictionary)
 
mNo edit summary
Line 2: Line 2:


* a priority
* a priority
* left and right spaces (in 1/18th of em). A value between 0 and 7.
* leading and trailing spaces (in 1/18th of em). A value between 0 and 7.
* minsize (in em). 1em by default.
* minsize/maxsize
* properties (fence, separator, stretchy, symmetric, largeop, movablelimits, accent). Mentioned iff it is true.
* properties (fence, separator, stretchy, symmetric, largeop, movablelimits, accent, mirrorable). Mentioned iff it is true.


Our implementation uses a [https://developer.mozilla.org/en/XUL_Tutorial/Property_Files property file] with entries similar to what is described above. The property name is <tt>operator.\u[NNNN].[form]</tt> where <tt>[NNNN]</tt> is the unicode code point and <tt>[form]</tt> the operator form. The value of the property is a list of several <tt>AttributeName</tt> or <tt>AttributeName:AttributeValue</tt> (depending whether it is a boolean valued attributes or not) separated by whitespaces. Compared to the MathML3 dictionary, we do not have the "priority" attribute but the additional attributes below:
Our implementation uses a [https://developer.mozilla.org/en/XUL_Tutorial/Property_Files property file] with entries similar to what is described above. The property name is <tt>operator.\u[NNNN].[form]</tt> where <tt>[NNNN]</tt> is the unicode code point and <tt>[form]</tt> the operator form. The value of the property is a list of several <tt>AttributeName</tt> or <tt>AttributeName:AttributeValue</tt> (depending whether it is a boolean valued attributes or not) separated by whitespaces. Compared to the MathML3 dictionary, we don't include the "priority" attribute but have the additional attribute:


* direction: horizontal, vertical (XXXfred add updiagonal, downdiagonal later?)
* direction: horizontal, vertical (XXXfred add updiagonal, downdiagonal later?)
* (XXXfred add mirrorable later?)


Finally, the end of the line after a sharp is considered as a comment: we use this to give the glyph or name of the character. Thus, a typical entry is:
Finally, the end of the line after a sharp is considered as a comment: we use this to give the glyph or name of the character. Thus, a typical entry is:
Line 17: Line 16:
</pre>
</pre>


Our Operator Dictionary is stored in [http://mxr.mozilla.org/mozilla-central/source/layout/mathml/mathfont.properties#119 mathfont.properties].
Our Operator Dictionary is stored in [http://mxr.mozilla.org/mozilla-central/source/layout/mathml/mathfont.properties mathfont.properties].

Revision as of 19:53, 19 February 2012

The MathML 3 Operator Dictionary indexes each operator by a character (an unicode code point) in a given form (prefix, infix or postfix). Each operator has the following attributes:

  • a priority
  • leading and trailing spaces (in 1/18th of em). A value between 0 and 7.
  • minsize/maxsize
  • properties (fence, separator, stretchy, symmetric, largeop, movablelimits, accent, mirrorable). Mentioned iff it is true.

Our implementation uses a property file with entries similar to what is described above. The property name is operator.\u[NNNN].[form] where [NNNN] is the unicode code point and [form] the operator form. The value of the property is a list of several AttributeName or AttributeName:AttributeValue (depending whether it is a boolean valued attributes or not) separated by whitespaces. Compared to the MathML3 dictionary, we don't include the "priority" attribute but have the additional attribute:

  • direction: horizontal, vertical (XXXfred add updiagonal, downdiagonal later?)

Finally, the end of the line after a sharp is considered as a comment: we use this to give the glyph or name of the character. Thus, a typical entry is:

operator.\u0028.prefix = direction:vertical stretchy fence symmetric lspace:0 rspace:0 # (

Our Operator Dictionary is stored in mathfont.properties.