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 Robert Schmid <ro...@fourthgen.com> on 2000/11/13 20:32:54 UTC
I wanna contribute!
I have just gotten clearance to spend work time on contributing to
FOP. I'm about to go start reading everything in sight but I was hoping
someone would contact me and give me a little direction as to where to look
first and what to start working on first.
Re: Where I am - where I can go. Re: I wanna contribute!
Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
At 03:12 PM 11/13/00 -0600, Robert Schmid wrote:
>
>I think Steve has a better course of action for me to get started. I still
>need to
>
>A) Read chapters 1-4 of the specification
>B) Learn the Apache development & Contribution process
>C) Get the latest repository to compile (having problems there.)
>D) Get to know the current code.
This is good. Particularly C. :-) What's going on there?
>The stuff Steve has laid out fits well into these areas. On the other
>hand, in order to work on xsl:fo compliance I think I need to learn the PDF
>specification first, don't I?
This spec is pretty secondary. You can do lots of useful FOP work and not
know PDF at all. It is just the primary target display format, but FOP is
not dependent on it in any way.
>But keep the ideas and recommendations coming, I'll dive into the
>documentation soon and catch you in a few days (weeks?).
When I pry loose the time I'll be updating our architectural/high-level
design docs. Keep an eye peeled...
Arved
Senior Developer
e-plicity.com (www.e-plicity.com)
Halifax, Nova Scotia
"B2B Wireless in Canada's Ocean Playground"
Where I am - where I can go. Re: I wanna contribute!
Posted by Robert Schmid <ro...@fourthgen.com>.
I think Steve has a better course of action for me to get started. I still
need to
A) Read chapters 1-4 of the specification
B) Learn the Apache development & Contribution process
C) Get the latest repository to compile (having problems there.)
D) Get to know the current code.
The stuff Steve has laid out fits well into these areas. On the other
hand, in order to work on xsl:fo compliance I think I need to learn the PDF
specification first, don't I?
But keep the ideas and recommendations coming, I'll dive into the
documentation soon and catch you in a few days (weeks?).
At 09:55 PM 11/13/2000 +0100, you wrote:
> > I have just gotten clearance to spend work time on contributing to
> > FOP. I'm about to go start reading everything in sight but I was hoping
> > someone would contact me and give me a little direction as to where to
> look
> > first and what to start working on first.
>
>This is really great!
>There are many problems you could start with, my special favourite
>is hyphenation, because this is quite necessary for many languages
>with long words. But I think the best would be, if you look at the file
>STATUS in the root of the Fop distribution. The next target is basic
>conformance with xsl:fo; there are some flow objects to implement to
>get there:
>
> fo:character
> fo:declarations
> fo:leader [at the moment only partially]
> fo:multi-case
> fo:table-and-caption
> fo:table-header
> fo:wrapper
>
>And there you also find a list of the properties which have to be
>implemented. Maybe something like fo:leader (which is used to
>create lines between paragraphs but also for the dots between an
>title and the page number or to create entry fields in fill-in-the-blank
>forms) is a good starting point, because it must be implemented for
>basic conformance ;-), it is rather self-contained (can you say
>that?), and the existing code gives you some ideas but has to be
>rewritten. You could start with just one property. Or fix the
>momentary status: at the moment it is a block fo, but it should be an
>inline fo.
>
>Reading tips:
>Read the documentation (all wrapped up in one pdf file, if you run
>makedoc in docs/xml-docs/, especially Arved's overview over Fop
>architecture.
>
>Here is an overview which has been sent to this group a few days
>ago and which you might find helpful.
>
>Fotis
>
>Send reply to: fop-dev@xml.apache.org
>From: "Richard Huxton" <de...@archonet.com>
>To: <fo...@xml.apache.org>
>Subject: Notes on FOP code
>Date sent: Thu, 2 Nov 2000 14:14:21 -0000
>
>[ Double-click this line for list subscription options ]
>
>A Brief Introduction to FOP's code
>==================================
>
>Before reading this document
>============================
>You should have a look at docs/design/xxx.gif for some UML
>diagrams and
>docs/html-docs/architecture.html
>
>This document is a tidied copy of my notes made while looking
>through the code
>and covers much the same ground as architecture.html but from a
>slightly
>different viewpoint. I recommend flicking between the two while
>looking at the
>source.
>
>Bear in mind that not only am I not a FOP expert, I don't even
>consider myself
>as a Java programmer.
>
>If you have any comments/corrections on this you can reach me at
>dev@archonet.com
>
>- Richard Huxton 2000-10-02.
>
>
>Miscellaneous notes
>===================
>This is based on v0.14 of FOP - it will probably date very quickly.
>
>The Ant build process copies files from src/ to build/ and generates
>some .java
>files from .xml
>
>To add tracing code make sure you
> import org.apache.fop.messaging.MessageHandler;
>at the top of a file and then use
> MessageHandler.logln("print to STDIO");
>or
> MessageHandler.logln("print to STDERR");
>
>
>
>What happens when you execute CommandLine
>=========================================
>Driver()
> Create an FOTreeBuilder treeBuilder
>
>Driver.buildFOTree
> parses the XML of the .fo document (sending SAX events to
>treeBuilder)
>
>Driver.format()
> areaTree = new AreaTree
> treeBuilder.format(areaTree)
>
>Driver.render()
> renderer.render(areaTree, writer-object)
>
>
>
>Building the FO Tree
>====================
>There are a number of XXXMapping classes in fo/ that map XML
>elements and
>properties to maker() methods in the various classes. For example,
>StandardElementMapping has many calls like:
>
> builder.addMapping(uri, "block", Block.maker());
>
>The TreeBuilder has methods such as startElement() and
>endElement() to receive
>SAX events and uses the mappings to call the relevant FO maker()
>methods.
>
>The whole FO tree ends up in rootFObj.
>
>
>
>Building the area tree (fomatting)
>==================================
>FOTreeBuilder.format(AreaTree)
> root.format(areaTree)
>
>Root.format(AreaTree)
> for each PageSequence p {
> p.format(areaTree)
> }
>
>Class Root is in the fo/pagination subtree.
>
>
>Note that staticBefore and staticAfter are class StaticContent and
>are flow
>objects wheras AreaContainer is in the layout branch.
>
>PageSequence.format(AreaTree)
> do {
> currentPage = makePage(areaTree)
> this.staticBefore.layout(beforeArea);
>
> AreaContainer afterArea = currentPage.getAfter();
> this.staticAfter.layout(afterArea);
>
> AreaContainer bodyArea = currentPage.getBody();
> status = this.flow.layout(bodyArea);
>
> areaTree.addPage(currentPage);
> } while ( status.isIncomplete() );
>
>
>We now start to encounter fo/flow objects...
>
>Flow.layout(Area)
> for each child FObj fo {
> fo.layout(area)
> }
>
>
>Now the children of the root flow-object are also flow objects and are
>such
>things as Block, BlockContainer, Table, InlineGraphic etc.
>
>Here's an example from Block - note the use of instance variable
>"marker" to
>track the position within the block. This means we can come back
>and continue
>layout if we can't complete it at the present time (run out of space in
>this
>area). BlockArea is a subclass of Area.
>
>
>Block.layout(Area)
> if (marker==START) {
> set a load of properties (fonts, spacing etc)
> marker = 0
> }
> this.blockArea = new BlockArea(properties...)
> for (i=marker; i<numChildren; i++) {
> fo = child[i]
> status = fo.layout(blockArea)
> if (status.isIncomplete()) {
> marker = i
> area.addChild(blockArea)
> return status;
> }
> }
> area.addChild(blockArea)
> return new Status(Status.OK)
>
>The Status object is used to track the results of laying out the FO
>tree. It
>indicates when layout of an object is complete/unfinished and also
>page-breaks/keep-with info.
>
>
>
>The rendering process (producing PDF)
>=====================================
>Rendering is a matter of translating the page areas into the relevant
>output
>format (PDF) - we've already done the hard work of layout.
>
>
>Gets the root of the area-tree
>For each page {
> renderAreaContainer(before)
> renderAreaContainer(body)
> renderAreaContainer(after)
>}
>
>
>renderAreaContainer() {
> for each child Box b {
> b.render(this)
> }
>}
>
>
>Each of the XXXArea classes in layout call the relevant renderXXX
>fn in
>PDFRenderer e.g. InlineArea.render() calls
>renderer.renderInlineArea().
>
>[END]
Re: I wanna contribute!
Posted by Fotis Jannidis <fo...@lrz.uni-muenchen.de>.
> I have just gotten clearance to spend work time on contributing to
> FOP. I'm about to go start reading everything in sight but I was hoping
> someone would contact me and give me a little direction as to where to look
> first and what to start working on first.
This is really great!
There are many problems you could start with, my special favourite
is hyphenation, because this is quite necessary for many languages
with long words. But I think the best would be, if you look at the file
STATUS in the root of the Fop distribution. The next target is basic
conformance with xsl:fo; there are some flow objects to implement to
get there:
fo:character
fo:declarations
fo:leader [at the moment only partially]
fo:multi-case
fo:table-and-caption
fo:table-header
fo:wrapper
And there you also find a list of the properties which have to be
implemented. Maybe something like fo:leader (which is used to
create lines between paragraphs but also for the dots between an
title and the page number or to create entry fields in fill-in-the-blank
forms) is a good starting point, because it must be implemented for
basic conformance ;-), it is rather self-contained (can you say
that?), and the existing code gives you some ideas but has to be
rewritten. You could start with just one property. Or fix the
momentary status: at the moment it is a block fo, but it should be an
inline fo.
Reading tips:
Read the documentation (all wrapped up in one pdf file, if you run
makedoc in docs/xml-docs/, especially Arved's overview over Fop
architecture.
Here is an overview which has been sent to this group a few days
ago and which you might find helpful.
Fotis
Send reply to: fop-dev@xml.apache.org
From: "Richard Huxton" <de...@archonet.com>
To: <fo...@xml.apache.org>
Subject: Notes on FOP code
Date sent: Thu, 2 Nov 2000 14:14:21 -0000
[ Double-click this line for list subscription options ]
A Brief Introduction to FOP's code
==================================
Before reading this document
============================
You should have a look at docs/design/xxx.gif for some UML
diagrams and
docs/html-docs/architecture.html
This document is a tidied copy of my notes made while looking
through the code
and covers much the same ground as architecture.html but from a
slightly
different viewpoint. I recommend flicking between the two while
looking at the
source.
Bear in mind that not only am I not a FOP expert, I don't even
consider myself
as a Java programmer.
If you have any comments/corrections on this you can reach me at
dev@archonet.com
- Richard Huxton 2000-10-02.
Miscellaneous notes
===================
This is based on v0.14 of FOP - it will probably date very quickly.
The Ant build process copies files from src/ to build/ and generates
some .java
files from .xml
To add tracing code make sure you
import org.apache.fop.messaging.MessageHandler;
at the top of a file and then use
MessageHandler.logln("print to STDIO");
or
MessageHandler.logln("print to STDERR");
What happens when you execute CommandLine
=========================================
Driver()
Create an FOTreeBuilder treeBuilder
Driver.buildFOTree
parses the XML of the .fo document (sending SAX events to
treeBuilder)
Driver.format()
areaTree = new AreaTree
treeBuilder.format(areaTree)
Driver.render()
renderer.render(areaTree, writer-object)
Building the FO Tree
====================
There are a number of XXXMapping classes in fo/ that map XML
elements and
properties to maker() methods in the various classes. For example,
StandardElementMapping has many calls like:
builder.addMapping(uri, "block", Block.maker());
The TreeBuilder has methods such as startElement() and
endElement() to receive
SAX events and uses the mappings to call the relevant FO maker()
methods.
The whole FO tree ends up in rootFObj.
Building the area tree (fomatting)
==================================
FOTreeBuilder.format(AreaTree)
root.format(areaTree)
Root.format(AreaTree)
for each PageSequence p {
p.format(areaTree)
}
Class Root is in the fo/pagination subtree.
Note that staticBefore and staticAfter are class StaticContent and
are flow
objects wheras AreaContainer is in the layout branch.
PageSequence.format(AreaTree)
do {
currentPage = makePage(areaTree)
this.staticBefore.layout(beforeArea);
AreaContainer afterArea = currentPage.getAfter();
this.staticAfter.layout(afterArea);
AreaContainer bodyArea = currentPage.getBody();
status = this.flow.layout(bodyArea);
areaTree.addPage(currentPage);
} while ( status.isIncomplete() );
We now start to encounter fo/flow objects...
Flow.layout(Area)
for each child FObj fo {
fo.layout(area)
}
Now the children of the root flow-object are also flow objects and are
such
things as Block, BlockContainer, Table, InlineGraphic etc.
Here's an example from Block - note the use of instance variable
"marker" to
track the position within the block. This means we can come back
and continue
layout if we can't complete it at the present time (run out of space in
this
area). BlockArea is a subclass of Area.
Block.layout(Area)
if (marker==START) {
set a load of properties (fonts, spacing etc)
marker = 0
}
this.blockArea = new BlockArea(properties...)
for (i=marker; i<numChildren; i++) {
fo = child[i]
status = fo.layout(blockArea)
if (status.isIncomplete()) {
marker = i
area.addChild(blockArea)
return status;
}
}
area.addChild(blockArea)
return new Status(Status.OK)
The Status object is used to track the results of laying out the FO
tree. It
indicates when layout of an object is complete/unfinished and also
page-breaks/keep-with info.
The rendering process (producing PDF)
=====================================
Rendering is a matter of translating the page areas into the relevant
output
format (PDF) - we've already done the hard work of layout.
Gets the root of the area-tree
For each page {
renderAreaContainer(before)
renderAreaContainer(body)
renderAreaContainer(after)
}
renderAreaContainer() {
for each child Box b {
b.render(this)
}
}
Each of the XXXArea classes in layout call the relevant renderXXX
fn in
PDFRenderer e.g. InlineArea.render() calls
renderer.renderInlineArea().
[END]