[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-dev
Subject:    {before,after,start,end} vs {top,bottom,left,right}
From:       Glenn Adams <glenn () skynav ! com>
Date:       2011-06-13 5:49:39
Message-ID: BANLkTimOZ+myOoCKkBUyOtRcemUi3FRK8Q () mail ! gmail ! com
[Download RAW message or body]

FYI.

In my complex script work, I find it useful to change the IF schema and the
IFPainter interface to replace the mis-use of writing-mode relative edge
names with absolute edge names. In particular, I'm
changing {before,after,start,end} to {top,bottom,left,right} in
IFPainter.drawBorderRect(...) which will read as follows:

   /**


     * Draws a border rectangle. The border segments are specified through
{@link BorderProps}

     * instances.


     * @param rect the rectangle's coordinates and extent


     * @param top the border segment on the top edge


     * @param bottom the border segment on the bottom edge


     * @param left the border segment on the left edge


     * @param right the border segment on the right edge


     * @throws IFException if an error occurs while handling this event


     */
    void drawBorderRect(Rectangle rect,
            BorderProps top, BorderProps bottom,
            BorderProps left, BorderProps right) throws IFException;

The minor change in the IF schema is:

     <xs:element name="border-rect">
        <xs:complexType>
          <xs:attributeGroup ref="mf:rectAtts"/>
          <xs:attribute name="left" type="mf:borderDef"/>
          <xs:attribute name="right" type="mf:borderDef"/>
          <xs:attribute name="top" type="mf:borderDef"/>
          <xs:attribute name="bottom" type="mf:borderDef"/>
        </xs:complexType>
      </xs:element>

which attributes were previously mis-labeled as start, end, before, after,
respectively.

The reason the previous names were wrong is that by the time IFPainter (and
IFSerializer) gets invoked, the writing mode relative edges have been
resolved to absolute edges, and, in fact all the existing implementations of
IFPainter already assumed these meant the left-to-right mode absolute edge
equivalents, and are hard coded to interpret them as such.

Of course, this assumption no longer holds when introducing bidi support.
Technically, this change is not absolutely required, but continued mis-use
of relative names makes things very confusing at the IF layer, so the change
is warranted.

G.

[Attachment #3 (text/html)]

<div>FYI.</div><div><br></div>In my complex script work, I find it useful to change \
the IF schema and the IFPainter interface to replace the mis-use of writing-mode \
relative edge names with absolute edge names. In particular, I&#39;m changing \
{before,after,start,end} to {top,bottom,left,right} in IFPainter.drawBorderRect(...) \
which will read as follows:<div>

<br></div><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, \
monospace">   /**                                                                     \
</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">     * \
Draws a border rectangle. The border segments are specified through {@link \
BorderProps}                                                                          \
</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">     * \
instances.                                                                            \
</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">     * \
@param rect the rectangle&#39;s coordinates and extent                                \
</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">     * \
@param top the border segment on the top edge                                         \
</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">     * \
@param bottom the border segment on the bottom edge                                   \
</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">     * \
@param left the border segment on the left edge                                       \
</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">     * \
@param right the border segment on the right edge                                     \
</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">     * \
@throws IFException if an error occurs while handling this event                      \
</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">     \
*/</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, \
monospace">    void drawBorderRect(Rectangle rect,</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">          \
BorderProps top, BorderProps bottom,</font></div><div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace">            BorderProps left, BorderProps \
right) throws IFException;</font></div>

</div><div><br></div><div>The minor change in the IF schema \
is:</div><div><br></div><div><div><font class="Apple-style-span" face="&#39;courier \
new&#39;, monospace">     &lt;xs:element \
name=&quot;border-rect&quot;&gt;</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">        \
&lt;xs:complexType&gt;</font></div><div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace">          &lt;xs:attributeGroup \
ref=&quot;mf:rectAtts&quot;/&gt;</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">          \
&lt;xs:attribute name=&quot;left&quot; \
type=&quot;mf:borderDef&quot;/&gt;</font></div><div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace">          &lt;xs:attribute \
name=&quot;right&quot; type=&quot;mf:borderDef&quot;/&gt;</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">          \
&lt;xs:attribute name=&quot;top&quot; \
type=&quot;mf:borderDef&quot;/&gt;</font></div><div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace">          &lt;xs:attribute \
name=&quot;bottom&quot; type=&quot;mf:borderDef&quot;/&gt;</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">        \
&lt;/xs:complexType&gt;</font></div><div><font class="Apple-style-span" \
face="&#39;courier new&#39;, monospace">      &lt;/xs:element&gt;</font></div>

</div><div><br></div><div>which attributes were previously mis-labeled as start, end, \
before, after, respectively.</div><div><br></div><div>The reason the previous names \
were wrong is that by the time IFPainter (and IFSerializer) gets invoked, the writing \
mode relative edges have been resolved to absolute edges, and, in fact all the \
existing implementations of IFPainter already assumed these meant the left-to-right \
mode absolute edge equivalents, and are hard coded to interpret them as such.</div>

<div><br></div><div>Of course, this assumption no longer holds when introducing bidi \
support. Technically, this change is not absolutely required, but continued mis-use \
of relative names makes things very confusing at the IF layer, so the change is \
warranted.</div>

<div><br></div><div>G.</div><div><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic