drawVerticalDelimiter
<xsl:template name="drawVerticalDelimiter"> <xsl:param name="delimiter"/> <xsl:param name="height"/> <xsl:param name="x"/> <xsl:param name="y"/> <xsl:param name="fontSize"/> <xsl:param name="variant"/> <xsl:param name="fontName" tunnel="yes"/> ... </xsl:template>
First of all, a verification must be done to know if the operator has to be stretched. If it does not have to stretch, it will be simply drawn
like a non-stretchy operator. After that, another verification checks if the operator can be composed, stretched or not. This verification
is done using the two structures: delimPart
and delimScale
. If the operator cannot be composed
or stretched, it will simply be centered by using a SVG
text
element. If the operator is in the
delimPart
structure, the operator will be composed, if the operator is in the delimScale
structure, the operator will be scaled.
The number of parts needed to compose the symbols is retrieved from the structure. This number will be used to know which type of operator
will be composed. After that, the index of part in the structure will be computed and the bounding box of each part will be retrieved from
the metrics. A correction is done to avoid the small gaps on the canvas. The next line computes the number of extensers that will be added
and the final font size of the operator calling the function findBestSize
. A new font size is computed in order to have
a round number of parts.
After all these computations, the bottom and the top parts of the operator will be drawn using a SVG
text
element. The top delimiter is only drawn if there are more than two parts or if the
extenser
attribute is bottom
. In the same way, the bottom delimiter is only draw if
there is more than two parts or if the extenser
attribute is top
. Now, the extenser
has to be drawn and the way to draw them depends on the number of parts.
If the operator has four parts (like a curly bracket for example), a middle part is then added using a text
element and
two groups of extenser are drawn around this middle part using drawVerticalExtenser
function. The extenser is only
drawn if the number returned by findBestSize
is bigger than zero.
If the operator has two or three parts, the extenser will be added if the number returned by findBestSize
is bigger than zero.
If the operator has two parts and if the extensers have to be drawn on the top, the Y
coordinate has
to be on the top of the box. In the other cases, it has to be under the top part of the operator.