Details
-
Improvement
-
Status: Closed
-
Resolution: Fixed
-
2.5
-
None
-
None
-
-
33760
Description
Fopdev's
I've been working on the AWTRenderer those last days. Before I move forward, I
would welcome some feedback to know if I'm heading in the right direction.
= What I did =
Basically, I tried to implement in AWTRenderer what the PDFRenderer does. The
drawback is that all what doesn't work for the PDFRenderer doesn't work for the
AWTRenderer neither.
I've posted a patch with the updated renderers. The patch has changes for the
classes AWTRenderer, AbstractRenderer, PDFRenderer and CTM plus a new class
BMPReader.
AWTRenderer: I implemented several renderXXX() methods and the corresponding
helper methods.
AbstractRenderer: I moved what I could reuse from PDFRenderer to
AbstractRenderer: renderTextDecorations(), handleRegionTraits(), and added the
needed empty methods.
PDFRenderer ans PSRenderer:
I moved 2 lines (currentIPPosition = 0; currentBPPosition = 0; ) in
startVParea() because the AWTRenderer uses those values in another way and need
to keep track of them (see startVParea() in AWTRenderer).
Speaking of startVParea(), could we rename it to something more meanigfull?
Proposition: TransformPosition, or something like this.
Deleted the methods moved to AbstractRenderer.
fop.area.CTM: added two getters for e and f. If there's another way to get those
values, please let me know.
= Points I would like to discuss (see the corresponding FIXME in the code) =
Fonts: I must be missing something with the font-mechanism: the rendered text in
the AWTRenderer is smaller that the one of PDFRenderer. What I need is a way to
get a java.awt.Font from an area.
Is the class FontSetup implemented correctly? Do I have to worry about
multibyte-stuff?
I could investigate the whole mechanism, but a hint would certainly speed my work.
Colors: My method updateColor (Graphics2D graphics, Area area) doesn't work for
some areas.Same question here: how can I get a java.awt.Color from ANY area?
There are still many issues with the positioning of the areas. I keep track of
the current position with the variables currentIPPosition and currentBPPosition.
Images: I can't update the currentIPDPosition and currentBPDPosition for
Image-areas. The Viewport associated with the image doesn't have any bpd
associated with it. Is this normal? The enclosed image doesn't have ipd/bpd
either. Again: is this normal so? I have a workaround in mind (getting those
values through the FopImage), but it doesn't sound right.
I implemented a simple .bmp rendering (BMPReader.java). It only supports 8-bit
and 24-bit uncompressed windows bitmap images. I found this code on the net. I
know you had problems with licences and I don't want to raise an issue here. I
did this implementation more for myself than anything. If there's a better way
to render .bmp (JAI?), let me know. Otherwise, I could try to convince the
author to donate the code in conterpart of some fine chocolate
SVG + External Objects rendering is very alpha.
renderTextDecoration(InlineArea) seems to work, even if it's not implemented??
renderViewport is overriden in PDFRenderer to allow clip(). Is this feature also
needed in AWTRenderer?
= What's next =
- fix the bugs described here
- implement the remaining features
- test the renderer on more complex files
- implement what's described on the wiki FopAndJava2D [1]
In the code, I used the following conventions: FIXME for the points I would like
you to review before checking the code in. And TODO for the points I still have
to work out (so please leave them). If someone using eclipse could mail me his
formatter (Preferences>Java>Code Style>Formatter, then Export profile), that
would be nice.
Any comments or suggestions most welcome. Again, please let me know if I'm doing
things the right way.
I wish you a nice weekstart.
Renaud