Paragraph styles and text alignment

Pascal Quesseveur <[email protected]> Thu, 29 Aug 2002 15:22:05 +0200
Newsgroups gmane.text.xml.jfor.devel
Organization ABAK Systèmes
Message-ID <[email protected]>
Hello,

I have almost finished the coding of paragraph style management. It
seems to
work, but character styles are no more available. It should be possible
to keep
character styles, but there is a need to distinguish between paragrah
and
character styles declaration in the stylesheet. In my opinion, the best
way is
to add a new keyword to declare a character style (or a paragraph style
if
backward compatibility is wanted), for example jfor:stylechar. The style
referencing is not changed.

I have implemented that option and tested it with Word 2000: paragraph
and
character styles are correctly recognized. I need some feedback before
going
further.

I have discovered one problem about text alignment. Suppose you have a
block
that references a style and sets a new value for text-alignement:

 <jfor:stylesheet>
  <jfor:style name="St1" text-align="start"
    font-size="14pt" font-family="Times"/>
 </jfor:stylesheet>

...

  <fo:block jfor-class="St1" text-align="center">Text in style St1.
   The block is centered.</fo:block>
...

The RTF document contains the both alignement values: the one inherited
from
the style (\ql), and the one set for the block (\qr). The order between
the two
values cannot be controled due to the HashMap by RtfAttributes. That is
the
reason why when you change the default style in the stylesheet, block
alignement directives are no more working. Even in the case you don't
define
text alignement in the style, left alignement is set by default.

One solution is to explicitly remove alignement attributes from the
variable
result in TextAttributesConverter before adding the new value. Once
again I
would be pleased to receive feedback.

One last thing about tables. Text alignement in cells doesn't work: all
the
cells in a row get the same alignment. The reason seems to come from the
group
mark that is inserted after \intbl. I have tested without writing that
mark
when m_parent is instance of RtfTableCell and it is OK, but perhaps
there is a
need for that mark that I can't guess.


-- 
[email protected]


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf