diff --git a/spec.html b/spec.html index e838f2a..5f4c61b 100644 --- a/spec.html +++ b/spec.html @@ -1738,6 +1738,10 @@

Layout of operators

color of the <mo> element.

+

+ Let dir be the element's computed + direction. +

Operators are laid out as follows:

  1. @@ -1745,6 +1749,12 @@

    Layout of operators

    made of a single character c then fall back to the layout algorithm of . + If it is not possible to get a glyph corresponding to + c given directionality dir, then + fall back to the layout algorithm of . + Otherwise, let g be the result of running + get a glyph corresponding to c + given directionality dir.
  2. If the operator has the [=embellished operator/stretchy=] property: @@ -1754,10 +1764,8 @@

    Layout of operators

    1. If it is not possible to shape a stretchy glyph - corresponding to c in the inline direction - with the - first available font - then fall back to the + g in the inline direction with the + first available font then fall back to the layout algorithm of .
    2. @@ -1777,13 +1785,13 @@

      Layout of operators

    3. The inline size and (ink) block metrics of the math content are given by algorithm to - shape a stretchy glyph to inline dimension - Tinline. + shape a stretchy glyph g to + inline dimension Tinline.
    4. The painting of the operator is performed by the algorithm - to shape a stretchy glyph + to shape a stretchy glyph g stretched to inline dimension Tinline and at position determined by the previous box metrics. @@ -1796,10 +1804,8 @@

      Layout of operators

      1. If it is not possible to shape a stretchy glyph - corresponding to c in the block direction - with the - first available font - then fall back to the + g in the block direction with the + first available font then fall back to the layout algorithm of .
      2. @@ -1862,7 +1868,7 @@

        Layout of operators

        Let minsize and maxsize be the [=embellished operator/minsize=] and [=embellished operator/maxsize=] properties on the operator. Percentage values are interpreted relative - to the height of the glyph for c. + to the height of g. Let T = Tascent + Tdescent be the target size. @@ -1920,7 +1926,7 @@

        Layout of operators

        line-descent of the math content are obtained by the algorithm to - shape a stretchy glyph + shape a stretchy glyph g to block dimension Tascent + Tdescent. @@ -1937,7 +1943,7 @@

        Layout of operators

      3. The painting of the operator is performed by the - algorithm to shape a stretchy glyph + algorithm to shape a stretchy glyph g stretched to block dimension Tascent + Tdescent @@ -1961,25 +1967,63 @@

        Layout of operators

        then:
        1. -

          - Use the - MathVariants - table to try and find a glyph of height at least - DisplayOperatorMinHeight. - If none is found, fall back to the - largest non-base glyph. If none is found, fall back to - the layout algorithm of . -

          + If it is not possible to shape a stretchy glyph + g in the block direction with the + first available font then fall back to the + layout algorithm of . +
          + Here we treat a non-[=embellished operator/stretchy=] [=embellished operator/largeop=] + glyph as stretchy with target dimension DisplayOperatorMinHeight. +
        2. - The min-content inline size, - max-content inline size, - inline size and block metrics of the math content - are given by the - glyph found. + The min-content inline size and + max-content inline size of the math content + are set to the preferred inline size of a glyph + stretched along the block axis. +
        3. +
        4. + The inline size, + ink line-ascent, + ink line-descent, + line-ascent and + line-descent + of the math content + are obtained by the algorithm to + shape a stretchy glyph g + to block dimension + DisplayOperatorMinHeight. + The inline size of the math content is the width of + the stretchy glyph. The stretchy glyph is shifted + towards the line-under by a value Δ so that its + center aligns with the center of the target when + [=embellished operator/symmetric=]: + the ink ascent of the math content is + the ascent of the stretchy glyph − Δ + and the ink descent of the math content is + the descent of the stretchy glyph + Δ. +
            +
          • + If the operator has the [=embellished operator/symmetric=] property, + then + Δ = [(ascent of stretchy glyph − descent of stretchy glyph) − 2 * AxisHeight] / 2. +
          • +
          • + Otherwise, + Δ = 0. +
          • +
          +
          + The point of Δ here is simply to vertically align the operator when [=embellished operator/symmetric=]. +
        5. - Paint the glyph. + The painting of the operator is performed by the + algorithm to shape a stretchy glyph g + stretched to block dimension + DisplayOperatorMinHeight + and at position determined by the previous box metrics + shifted by Δ towards the line-over.
        @@ -2838,8 +2882,11 @@
        Radical symbol
        of that element.

        - The radical glyph is the glyph obtained for the - character U+221A SQUARE ROOT. + Let dir be the computed direction + of the <msqrt> or <mroot> element. + The radical glyph is the glyph obtained as a result of running + get a glyph corresponding to the U+221A SQUARE ROOT character + given dir.

        The radical gap is given by @@ -2856,8 +2903,8 @@

        Radical symbol

        The box metrics of the radical glyph and painting of the surd are given by the algorithm to - shape a stretchy glyph to block dimension the - target size for the radical glyph. + shape a stretchy glyph to the + target size for the radical glyph in the block dimension.

        @@ -5639,6 +5686,55 @@

        Algorithms for glyph stretching

        such as the one suggested in . +

        + The algorithm to get a glyph corresponding to a character c given a directionality dir + is the following: +

        +
          +
        • + Let g be the glyph corresponding to c + in the first available font. + If it is not possible to find such a glyph, then exit with failure. +
        • +
        • + If dir is rtl: +
            +
          • + If there exists an OpenType rtlm variant of + g in the first available font, + then return it and exit with success. [[OPEN-FONT-FORMAT]] +
          • +
          • + Otherwise, if c has the Bidi_Mirrored property [[BIDI]]: +
              +
            • + If c has a corresponding mirrored codepoint, + c', then return the glyph corresponding + to c' and exit with success. + If it is not possible to find such a glyph, then exit with failure. +
            • +
            • + Otherwise, exit with failure. +
            • +
            +
            + These failure cases are for when a character should be mirrored + according to its Bidi_Mirrored property, but no corresponding codepoint + or glyph exists. +
            +
          • +
          • + Otherwise, return g and exit with success. +
          • +
          +
        • +
        • + Assert: dir is ltr. +
        • +
        • + Return g and exit with success. +
        • +