Bug 33760 - [Patch] current AWTRenderer
Summary: [Patch] current AWTRenderer
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: awt renderer (show other bugs)
Version: trunk
Hardware: PC Windows XP
: P3 enhancement
Target Milestone: ---
Assignee: fop-dev
URL: http://www.oslutions.com
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-27 23:51 UTC by renaud richardet
Modified: 2012-04-01 06:28 UTC (History)
1 user (show)



Attachments
[PATCH] implementation of the AWTRenderer (76.30 KB, patch)
2005-02-27 23:52 UTC, renaud richardet
Details | Diff
[PATCH] implementation of the AWTRenderer (2) (94.42 KB, patch)
2005-02-28 03:16 UTC, renaud richardet
Details | Diff
patch agains head for AWTRenderer (72.10 KB, patch)
2005-03-08 03:25 UTC, renaud richardet
Details | Diff
Unified diff against HEAD. (868.98 KB, patch)
2005-03-19 02:08 UTC, renaud richardet
Details | Diff
Unified diff against HEAD (254.45 KB, patch)
2005-06-08 23:13 UTC, renaud richardet
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description renaud richardet 2005-02-27 23:51:22 UTC
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

[1] http://wiki.apache.org/xmlgraphics-fop/FopAndJava2D
Comment 1 renaud richardet 2005-02-27 23:52:25 UTC
Created attachment 14371 [details]
[PATCH] implementation of the AWTRenderer
Comment 2 renaud richardet 2005-02-28 03:16:00 UTC
Created attachment 14372 [details]
[PATCH] implementation of the AWTRenderer (2)

PLEASE USE THIS PATCH INSTEAD (same as before, but after I understood how
Checkstyle works :)

Regards,
Renaud
Comment 3 renaud richardet 2005-03-08 03:25:02 UTC
Created attachment 14426 [details]
patch agains head for AWTRenderer
Comment 4 Jeremias Maerki 2005-03-08 12:53:12 UTC
Patch applied with modifications. Thanks a lot!
Comment 5 renaud richardet 2005-03-19 02:08:22 UTC
Created attachment 14520 [details]
Unified diff against HEAD.
Comment 6 renaud richardet 2005-06-08 23:13:15 UTC
Created attachment 15340 [details]
Unified diff against HEAD

please see my mail to the list for more details
Comment 7 Jeremias Maerki 2005-06-09 10:52:03 UTC
Patch applied. This stuff looks very good now. Thank you very much for your 
effort and the quick response, Renaud!
Comment 8 Glenn Adams 2012-04-01 06:28:44 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed