You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Sergey Simonchik <Se...@borland.com> on 2005/09/17 12:35:56 UTC

txt-rendering

Hi,

We've put mind to txt-rendering. :) Evidently converting to txt isn't
implemented yet. So, before code writing, it will be useful to discuss
different approaches of implementing it. By this moment we've found 3
possible basic approaches.
Here they are:
1) 
TxtRender extends AbstractRender and try to render AbstractTreeModel to txt
format. This approach similar to PDF. But unfortunately txt format is much
less flexible than PDF. 
Thus we need to modify area tree model in order to render it to txt format.

Details:
TxtRender extends AbstractRender and overloads some methods which process
model.

2)
The second idea is similar to RTF approach. TxtHandler extends
FOEventHandler and handles formatting objects by his own without
AreaTreeModel.
This doesn't allow us to use advantages of LayoutManager, for example lines
fragmentation.

3) 
The third approach consist of modifying formatting objects before
constructing area tree model.

After getting formatting objects we make a refinement consisting of some
procedures. One of them is converting font's attributes to default value
which most appropriate for txt render. As we have already realized its
Courier 10.

Details:
TxtHandler extends AreaTreeHandler and overloads only one method -
endPageSequence where refinement takes place.
TxtRender extends AbstractRender and overloads some methods which process
model. 
But unlike first approach we have to do much less because LayoutManager gets
modified formatting objects and returns better result.

We started developing third approach.

Good luck.


RE: txt-rendering

Posted by Sergey Simonchik <Se...@borland.com>.
Hi Jeremias,

May be it's impossible to understand our idea perfectly. Furthermore, we
still haven't ICLA and so we can't commit patch with new file (unfortunately
such file is 'TxtHandler.java').

Good luck.
 
> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> Sent: Friday, September 23, 2005 7:10 PM
> To: fop-dev@xmlgraphics.apache.org
> Cc: 'Danila Ermakov'
> Subject: Re: txt-rendering
> 
> Hi Sergey,
> 
> that certainly sounds better although I'm not sure I really understand
> why exactly you need to do these refinements. I assume that the
> TextRenderer will also work for most cases without the special
> AreaTreeHandler. I'm looking forward to having a look at your patch when
> it's ready.
> 
> On 23.09.2005 12:41:36 Sergey Simonchik wrote:
> > Hi Jeremias,
> >
> > We don't have in mind to change or modify any code in layout engine or
> code
> > of formatting objects itself.
> > It's just suggested to have our own handler which extends
> AreaTreeHandler.
> > This handler should do some refinement for txt (modifying tree of
> formatting
> > objects, for example changing font-size, etc). We emphasize that
> TxtHandler,
> > which extends AreaTreeHandler, is used only in txt case.
> > The method createFOEventHandler() return different FOEventHandler and in
> > case of txt output it should return TxtHandler.
> >
> > Good luck.
> >
> > > -----Original Message-----
> > > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> > > Sent: Thursday, September 22, 2005 7:11 PM
> > > To: fop-dev@xmlgraphics.apache.org
> > > Cc: 'Danila Ermakov'
> > > Subject: Re: txt-rendering
> > >
> > > Hi Sergey,
> > >
> > > would you please elaborate the modifications you suggest? I'd be very
> > > unhappy if we had to do changes in the layout engine just to
> accomodate
> > > the text renderer. I think I don't quite understand what you have in
> > > mind.
> > >
> > > Furthermore, I'm not sure if using different font-sizes in the case of
> > > the text renderer is a good idea. See also:
> > > http://xmlgraphics.apache.org/fop/output.html#txt
> > >
> > > On 22.09.2005 10:21:32 Sergey Simonchik wrote:
> > > > Hi,
> > > >
> > > > We've got into TxtRenderer that was in 0.20.5. It works fine for
> most of
> > > > examples but in some cases there are problems. For instance:
> > > >
> > > > ...
> > > > <fo:block text-align="right" font-size="10pt">Hi</fo:block>
> > > > <fo:block text-align="right" font-size="50pt">Helloworld</fo:block>
> > > > ...
> > > >
> > > > Align doesn't correct.
> > > >
> > > > It's seems that modifying formatting objects before constructing
> area
> > > tree
> > > > model may help to cope with such problems.
> > > >
> > > > > ------Original Message-----
> > > > > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> > > > > Sent: Saturday, September 17, 2005 3:29 PM
> > > > > To: fop-dev@xmlgraphics.apache.org
> > > > > Cc: Danila Ermakov
> > > > > Subject: Re: txt-rendering
> > > > >
> > > > > Hi Sergey,
> > > > > unfortunately, you didn't notice the TXTRenderer that was in
> 0.20.5
> > > [1].
> > > > > The text renderer seems to work fine for many people who work with
> FOP
> > > > > 0.20.5. IMO it should be simple to port that renderer to FOP
> Trunk.
> > > The
> > > > > TXTRenderer currently found in FOP Trunk is only an empty shell
> which
> > > > > needs to be filled. I'd investigate that before doing any serious
> > > coding
> > > > > on a completely new TextRenderer. Please have a look at
> TXTRenderer
> > > and
> > > > > get back to us so we can sort out any details. The old TXTRenderer
> is
> > > > > capable of creating good output without any special handling in
> the
> > > area
> > > > > tree. You will also find discussion snippets around the
> TXTRenderer in
> > > > > the mailing list archives which should give you an idea about its
> > > design.
> > > > > BTW, I'm glad that you're going to reintroduce the TextRenderer.
> > > > > AFAIK, there's still a open issue with a patch [2] where I asked
> you
> > > to
> > > > > send in an ICLA so I can commit the patch. So far, I haven't seen
> an
> > > > > ICLA being recorded with your name.
> > > > > [1]
> > > > http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/branches/fop-
> 0_20_2->
> > > > maintain/src/org/apache/fop/render/txt/
> > > > > [2] http://issues.apache.org/bugzilla/show_bug.cgi?id=36480
> > >
> > >
> > >
> > > Jeremias Maerki
> 
> 
> 
> Jeremias Maerki



RE: txt-rendering

Posted by Sergey Simonchik <Se...@borland.com>.
Hi Jeremias,

May be it's impossible to understand our idea perfectly. Furthermore, we
still haven't ICLA and so we can't commit patch with new file (unfortunately
such file is 'TxtHandler.java').

Good luck.
 
> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> Sent: Friday, September 23, 2005 7:10 PM
> To: fop-dev@xmlgraphics.apache.org
> Cc: 'Danila Ermakov'
> Subject: Re: txt-rendering
> 
> Hi Sergey,
> 
> that certainly sounds better although I'm not sure I really understand
> why exactly you need to do these refinements. I assume that the
> TextRenderer will also work for most cases without the special
> AreaTreeHandler. I'm looking forward to having a look at your patch when
> it's ready.
> 
> On 23.09.2005 12:41:36 Sergey Simonchik wrote:
> > Hi Jeremias,
> >
> > We don't have in mind to change or modify any code in layout engine or
> code
> > of formatting objects itself.
> > It's just suggested to have our own handler which extends
> AreaTreeHandler.
> > This handler should do some refinement for txt (modifying tree of
> formatting
> > objects, for example changing font-size, etc). We emphasize that
> TxtHandler,
> > which extends AreaTreeHandler, is used only in txt case.
> > The method createFOEventHandler() return different FOEventHandler and in
> > case of txt output it should return TxtHandler.
> >
> > Good luck.
> >
> > > -----Original Message-----
> > > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> > > Sent: Thursday, September 22, 2005 7:11 PM
> > > To: fop-dev@xmlgraphics.apache.org
> > > Cc: 'Danila Ermakov'
> > > Subject: Re: txt-rendering
> > >
> > > Hi Sergey,
> > >
> > > would you please elaborate the modifications you suggest? I'd be very
> > > unhappy if we had to do changes in the layout engine just to
> accomodate
> > > the text renderer. I think I don't quite understand what you have in
> > > mind.
> > >
> > > Furthermore, I'm not sure if using different font-sizes in the case of
> > > the text renderer is a good idea. See also:
> > > http://xmlgraphics.apache.org/fop/output.html#txt
> > >
> > > On 22.09.2005 10:21:32 Sergey Simonchik wrote:
> > > > Hi,
> > > >
> > > > We've got into TxtRenderer that was in 0.20.5. It works fine for
> most of
> > > > examples but in some cases there are problems. For instance:
> > > >
> > > > ...
> > > > <fo:block text-align="right" font-size="10pt">Hi</fo:block>
> > > > <fo:block text-align="right" font-size="50pt">Helloworld</fo:block>
> > > > ...
> > > >
> > > > Align doesn't correct.
> > > >
> > > > It's seems that modifying formatting objects before constructing
> area
> > > tree
> > > > model may help to cope with such problems.
> > > >
> > > > > ------Original Message-----
> > > > > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> > > > > Sent: Saturday, September 17, 2005 3:29 PM
> > > > > To: fop-dev@xmlgraphics.apache.org
> > > > > Cc: Danila Ermakov
> > > > > Subject: Re: txt-rendering
> > > > >
> > > > > Hi Sergey,
> > > > > unfortunately, you didn't notice the TXTRenderer that was in
> 0.20.5
> > > [1].
> > > > > The text renderer seems to work fine for many people who work with
> FOP
> > > > > 0.20.5. IMO it should be simple to port that renderer to FOP
> Trunk.
> > > The
> > > > > TXTRenderer currently found in FOP Trunk is only an empty shell
> which
> > > > > needs to be filled. I'd investigate that before doing any serious
> > > coding
> > > > > on a completely new TextRenderer. Please have a look at
> TXTRenderer
> > > and
> > > > > get back to us so we can sort out any details. The old TXTRenderer
> is
> > > > > capable of creating good output without any special handling in
> the
> > > area
> > > > > tree. You will also find discussion snippets around the
> TXTRenderer in
> > > > > the mailing list archives which should give you an idea about its
> > > design.
> > > > > BTW, I'm glad that you're going to reintroduce the TextRenderer.
> > > > > AFAIK, there's still a open issue with a patch [2] where I asked
> you
> > > to
> > > > > send in an ICLA so I can commit the patch. So far, I haven't seen
> an
> > > > > ICLA being recorded with your name.
> > > > > [1]
> > > > http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/branches/fop-
> 0_20_2->
> > > > maintain/src/org/apache/fop/render/txt/
> > > > > [2] http://issues.apache.org/bugzilla/show_bug.cgi?id=36480
> > >
> > >
> > >
> > > Jeremias Maerki
> 
> 
> 
> Jeremias Maerki



Re: txt-rendering

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Hi Sergey,

that certainly sounds better although I'm not sure I really understand
why exactly you need to do these refinements. I assume that the
TextRenderer will also work for most cases without the special
AreaTreeHandler. I'm looking forward to having a look at your patch when
it's ready.

On 23.09.2005 12:41:36 Sergey Simonchik wrote:
> Hi Jeremias,
> 
> We don't have in mind to change or modify any code in layout engine or code
> of formatting objects itself.
> It's just suggested to have our own handler which extends AreaTreeHandler.
> This handler should do some refinement for txt (modifying tree of formatting
> objects, for example changing font-size, etc). We emphasize that TxtHandler,
> which extends AreaTreeHandler, is used only in txt case.
> The method createFOEventHandler() return different FOEventHandler and in
> case of txt output it should return TxtHandler.
> 
> Good luck.
> 
> > -----Original Message-----
> > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> > Sent: Thursday, September 22, 2005 7:11 PM
> > To: fop-dev@xmlgraphics.apache.org
> > Cc: 'Danila Ermakov'
> > Subject: Re: txt-rendering
> > 
> > Hi Sergey,
> > 
> > would you please elaborate the modifications you suggest? I'd be very
> > unhappy if we had to do changes in the layout engine just to accomodate
> > the text renderer. I think I don't quite understand what you have in
> > mind.
> > 
> > Furthermore, I'm not sure if using different font-sizes in the case of
> > the text renderer is a good idea. See also:
> > http://xmlgraphics.apache.org/fop/output.html#txt
> > 
> > On 22.09.2005 10:21:32 Sergey Simonchik wrote:
> > > Hi,
> > >
> > > We've got into TxtRenderer that was in 0.20.5. It works fine for most of
> > > examples but in some cases there are problems. For instance:
> > >
> > > ...
> > > <fo:block text-align="right" font-size="10pt">Hi</fo:block>
> > > <fo:block text-align="right" font-size="50pt">Helloworld</fo:block>
> > > ...
> > >
> > > Align doesn't correct.
> > >
> > > It's seems that modifying formatting objects before constructing area
> > tree
> > > model may help to cope with such problems.
> > >
> > > > ------Original Message-----
> > > > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> > > > Sent: Saturday, September 17, 2005 3:29 PM
> > > > To: fop-dev@xmlgraphics.apache.org
> > > > Cc: Danila Ermakov
> > > > Subject: Re: txt-rendering
> > > >
> > > > Hi Sergey,
> > > > unfortunately, you didn't notice the TXTRenderer that was in 0.20.5
> > [1].
> > > > The text renderer seems to work fine for many people who work with FOP
> > > > 0.20.5. IMO it should be simple to port that renderer to FOP Trunk.
> > The
> > > > TXTRenderer currently found in FOP Trunk is only an empty shell which
> > > > needs to be filled. I'd investigate that before doing any serious
> > coding
> > > > on a completely new TextRenderer. Please have a look at TXTRenderer
> > and
> > > > get back to us so we can sort out any details. The old TXTRenderer is
> > > > capable of creating good output without any special handling in the
> > area
> > > > tree. You will also find discussion snippets around the TXTRenderer in
> > > > the mailing list archives which should give you an idea about its
> > design.
> > > > BTW, I'm glad that you're going to reintroduce the TextRenderer.
> > > > AFAIK, there's still a open issue with a patch [2] where I asked you
> > to
> > > > send in an ICLA so I can commit the patch. So far, I haven't seen an
> > > > ICLA being recorded with your name.
> > > > [1]
> > > http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/branches/fop-0_20_2->
> > > maintain/src/org/apache/fop/render/txt/
> > > > [2] http://issues.apache.org/bugzilla/show_bug.cgi?id=36480
> > 
> > 
> > 
> > Jeremias Maerki



Jeremias Maerki


Re: txt-rendering

Posted by Chris Bowditch <bo...@hotmail.com>.
Jeremias Maerki wrote:

> Hi Sergey,
> 
> would you please elaborate the modifications you suggest? I'd be very
> unhappy if we had to do changes in the layout engine just to accomodate
> the text renderer. I think I don't quite understand what you have in
> mind.

I tend to agree. If the Text Renderer requires specialized logic in 
Layout or FO Tree then it won't be possible to send an Area Tree 
representation to any renderer.

Chris



RE: txt-rendering

Posted by Sergey Simonchik <Se...@borland.com>.
Hi Jeremias,

We don't have in mind to change or modify any code in layout engine or code
of formatting objects itself.
It's just suggested to have our own handler which extends AreaTreeHandler.
This handler should do some refinement for txt (modifying tree of formatting
objects, for example changing font-size, etc). We emphasize that TxtHandler,
which extends AreaTreeHandler, is used only in txt case.
The method createFOEventHandler() return different FOEventHandler and in
case of txt output it should return TxtHandler.

Good luck.

> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> Sent: Thursday, September 22, 2005 7:11 PM
> To: fop-dev@xmlgraphics.apache.org
> Cc: 'Danila Ermakov'
> Subject: Re: txt-rendering
> 
> Hi Sergey,
> 
> would you please elaborate the modifications you suggest? I'd be very
> unhappy if we had to do changes in the layout engine just to accomodate
> the text renderer. I think I don't quite understand what you have in
> mind.
> 
> Furthermore, I'm not sure if using different font-sizes in the case of
> the text renderer is a good idea. See also:
> http://xmlgraphics.apache.org/fop/output.html#txt
> 
> On 22.09.2005 10:21:32 Sergey Simonchik wrote:
> > Hi,
> >
> > We've got into TxtRenderer that was in 0.20.5. It works fine for most of
> > examples but in some cases there are problems. For instance:
> >
> > ...
> > <fo:block text-align="right" font-size="10pt">Hi</fo:block>
> > <fo:block text-align="right" font-size="50pt">Helloworld</fo:block>
> > ...
> >
> > Align doesn't correct.
> >
> > It's seems that modifying formatting objects before constructing area
> tree
> > model may help to cope with such problems.
> >
> > > ------Original Message-----
> > > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch]
> > > Sent: Saturday, September 17, 2005 3:29 PM
> > > To: fop-dev@xmlgraphics.apache.org
> > > Cc: Danila Ermakov
> > > Subject: Re: txt-rendering
> > >
> > > Hi Sergey,
> > > unfortunately, you didn't notice the TXTRenderer that was in 0.20.5
> [1].
> > > The text renderer seems to work fine for many people who work with FOP
> > > 0.20.5. IMO it should be simple to port that renderer to FOP Trunk.
> The
> > > TXTRenderer currently found in FOP Trunk is only an empty shell which
> > > needs to be filled. I'd investigate that before doing any serious
> coding
> > > on a completely new TextRenderer. Please have a look at TXTRenderer
> and
> > > get back to us so we can sort out any details. The old TXTRenderer is
> > > capable of creating good output without any special handling in the
> area
> > > tree. You will also find discussion snippets around the TXTRenderer in
> > > the mailing list archives which should give you an idea about its
> design.
> > > BTW, I'm glad that you're going to reintroduce the TextRenderer.
> > > AFAIK, there's still a open issue with a patch [2] where I asked you
> to
> > > send in an ICLA so I can commit the patch. So far, I haven't seen an
> > > ICLA being recorded with your name.
> > > [1]
> > http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/branches/fop-0_20_2->
> > maintain/src/org/apache/fop/render/txt/
> > > [2] http://issues.apache.org/bugzilla/show_bug.cgi?id=36480
> 
> 
> 
> Jeremias Maerki


Re: txt-rendering

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Hi Sergey,

would you please elaborate the modifications you suggest? I'd be very
unhappy if we had to do changes in the layout engine just to accomodate
the text renderer. I think I don't quite understand what you have in
mind.

Furthermore, I'm not sure if using different font-sizes in the case of
the text renderer is a good idea. See also:
http://xmlgraphics.apache.org/fop/output.html#txt

On 22.09.2005 10:21:32 Sergey Simonchik wrote:
> Hi,
> 
> We've got into TxtRenderer that was in 0.20.5. It works fine for most of
> examples but in some cases there are problems. For instance:
> 
> ...
> <fo:block text-align="right" font-size="10pt">Hi</fo:block>
> <fo:block text-align="right" font-size="50pt">Helloworld</fo:block>
> ...
> 
> Align doesn't correct.
> 
> It's seems that modifying formatting objects before constructing area tree
> model may help to cope with such problems.
> 
> > ------Original Message-----
> > From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> > Sent: Saturday, September 17, 2005 3:29 PM
> > To: fop-dev@xmlgraphics.apache.org
> > Cc: Danila Ermakov
> > Subject: Re: txt-rendering
> >
> > Hi Sergey, 
> > unfortunately, you didn't notice the TXTRenderer that was in 0.20.5 [1]. 
> > The text renderer seems to work fine for many people who work with FOP 
> > 0.20.5. IMO it should be simple to port that renderer to FOP Trunk. The 
> > TXTRenderer currently found in FOP Trunk is only an empty shell which 
> > needs to be filled. I'd investigate that before doing any serious coding 
> > on a completely new TextRenderer. Please have a look at TXTRenderer and 
> > get back to us so we can sort out any details. The old TXTRenderer is 
> > capable of creating good output without any special handling in the area 
> > tree. You will also find discussion snippets around the TXTRenderer in 
> > the mailing list archives which should give you an idea about its design. 
> > BTW, I'm glad that you're going to reintroduce the TextRenderer. 
> > AFAIK, there's still a open issue with a patch [2] where I asked you to 
> > send in an ICLA so I can commit the patch. So far, I haven't seen an 
> > ICLA being recorded with your name. 
> > [1]
> http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/branches/fop-0_20_2->
> maintain/src/org/apache/fop/render/txt/ 
> > [2] http://issues.apache.org/bugzilla/show_bug.cgi?id=36480



Jeremias Maerki


RE: txt-rendering

Posted by Sergey Simonchik <Se...@borland.com>.
Hi,

We've got into TxtRenderer that was in 0.20.5. It works fine for most of
examples but in some cases there are problems. For instance:

...
<fo:block text-align="right" font-size="10pt">Hi</fo:block>
<fo:block text-align="right" font-size="50pt">Helloworld</fo:block>
...

Align doesn't correct.

It's seems that modifying formatting objects before constructing area tree
model may help to cope with such problems.

> ------Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> Sent: Saturday, September 17, 2005 3:29 PM
> To: fop-dev@xmlgraphics.apache.org
> Cc: Danila Ermakov
> Subject: Re: txt-rendering
>
> Hi Sergey, 
> unfortunately, you didn't notice the TXTRenderer that was in 0.20.5 [1]. 
> The text renderer seems to work fine for many people who work with FOP 
> 0.20.5. IMO it should be simple to port that renderer to FOP Trunk. The 
> TXTRenderer currently found in FOP Trunk is only an empty shell which 
> needs to be filled. I'd investigate that before doing any serious coding 
> on a completely new TextRenderer. Please have a look at TXTRenderer and 
> get back to us so we can sort out any details. The old TXTRenderer is 
> capable of creating good output without any special handling in the area 
> tree. You will also find discussion snippets around the TXTRenderer in 
> the mailing list archives which should give you an idea about its design. 
> BTW, I'm glad that you're going to reintroduce the TextRenderer. 
> AFAIK, there's still a open issue with a patch [2] where I asked you to 
> send in an ICLA so I can commit the patch. So far, I haven't seen an 
> ICLA being recorded with your name. 
> [1]
http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/branches/fop-0_20_2->
maintain/src/org/apache/fop/render/txt/ 
> [2] http://issues.apache.org/bugzilla/show_bug.cgi?id=36480


RE: txt-rendering

Posted by Sergey Simonchik <Se...@borland.com>.
-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
Sent: Saturday, September 17, 2005 3:29 PM
To: fop-dev@xmlgraphics.apache.org
Cc: Danila Ermakov
Subject: Re: txt-rendering

> AFAIK, there's still a open issue with a patch [2] where I asked you to 
> send in an ICLA so I can commit the patch. So far, I haven't seen an 
> ICLA being recorded with your name. 

Meanwhile, our lawer disallow ICLA using, but it's possible, soon we'll get
modified ICLA.


RE: txt-rendering

Posted by Sergey Simonchik <Se...@borland.com>.

-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
Sent: Saturday, September 17, 2005 3:29 PM
To: fop-dev@xmlgraphics.apache.org
Cc: Danila Ermakov
Subject: Re: txt-rendering

> Hi Sergey, 
> unfortunately, you didn't notice the TXTRenderer that was in 0.20.5 [1]. 
> The text renderer seems to work fine for many people who work with FOP 
> 0.20.5. IMO it should be simple to port that renderer to FOP Trunk. The 
> TXTRenderer currently found in FOP Trunk is only an empty shell which 
> needs to be filled. I'd investigate that before doing any serious coding 
> on a completely new TextRenderer. Please have a look at TXTRenderer and 
> get back to us so we can sort out any details. The old TXTRenderer is 
> capable of creating good output without any special handling in the area 
> tree. You will also find discussion snippets around the TXTRenderer in 
> the mailing list archives which should give you an idea about its design. 
> BTW, I'm glad that you're going to reintroduce the TextRenderer.

Oh, it was indiscreet for my part to offer something without previous code
preview.
So, now I'll yield to your advice.
Thanks.

Sergey Simonchik.


Re: txt-rendering

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Hi Sergey,

unfortunately, you didn't notice the TXTRenderer that was in 0.20.5 [1].
The text renderer seems to work fine for many people who work with FOP
0.20.5. IMO it should be simple to port that renderer to FOP Trunk. The
TXTRenderer currently found in FOP Trunk is only an empty shell which
needs to be filled. I'd investigate that before doing any serious coding
on a completely new TextRenderer. Please have a look at TXTRenderer and
get back to us so we can sort out any details. The old TXTRenderer is
capable of creating good output without any special handling in the area
tree. You will also find discussion snippets around the TXTRenderer in
the mailing list archives which should give you an idea about its design.

BTW, I'm glad that you're going to reintroduce the TextRenderer.

AFAIK, there's still a open issue with a patch [2] where I asked you to
send in an ICLA so I can commit the patch. So far, I haven't seen an
ICLA being recorded with your name.

[1] http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/branches/fop-0_20_2-maintain/src/org/apache/fop/render/txt/
[2] http://issues.apache.org/bugzilla/show_bug.cgi?id=36480

On 17.09.2005 12:35:56 Sergey Simonchik wrote:
> Hi,
> 
> We've put mind to txt-rendering. :) Evidently converting to txt isn't
> implemented yet. So, before code writing, it will be useful to discuss
> different approaches of implementing it. By this moment we've found 3
> possible basic approaches.
> Here they are:
> 1) 
> TxtRender extends AbstractRender and try to render AbstractTreeModel to txt
> format. This approach similar to PDF. But unfortunately txt format is much
> less flexible than PDF. 
> Thus we need to modify area tree model in order to render it to txt format.
> 
> Details:
> TxtRender extends AbstractRender and overloads some methods which process
> model.
> 
> 2)
> The second idea is similar to RTF approach. TxtHandler extends
> FOEventHandler and handles formatting objects by his own without
> AreaTreeModel.
> This doesn't allow us to use advantages of LayoutManager, for example lines
> fragmentation.
> 
> 3) 
> The third approach consist of modifying formatting objects before
> constructing area tree model.
> 
> After getting formatting objects we make a refinement consisting of some
> procedures. One of them is converting font's attributes to default value
> which most appropriate for txt render. As we have already realized its
> Courier 10.
> 
> Details:
> TxtHandler extends AreaTreeHandler and overloads only one method -
> endPageSequence where refinement takes place.
> TxtRender extends AbstractRender and overloads some methods which process
> model. 
> But unlike first approach we have to do much less because LayoutManager gets
> modified formatting objects and returns better result.
> 
> We started developing third approach.
> 
> Good luck.



Jeremias Maerki