Created attachment 23157 [details] tiling patterns patch This patch allows to make and use postscript tiling patterns. Tiling patterns consist of a small graphical figure (called a pattern cell) that is replicated at fixed horizontal and vertical intervals to fill the area to be painted. Notice that a image (a texture) must not be a too large, otherwise the postscript error 'limitcheck' will be generated (on ps printer or in ps viewer).
Sorry for not responding earlier. Thank you for your patch. This is a nice addition. However, before I can process your patch, can I ask you to do the following: - Since your patch includes new files, please fill out and send an ICLA (Individual Contributor License Agreement, see [1] for details). Depending on your work contract you may also need to ask your employer to consider sending in a CCLA. [1] http://apache.org/licenses/#clas - Please put the same license header you find in our other source files on top of the new files you create to clearly indicate that you are donating this to the ASF. - And finally, please rework the patch to make it Java 1.4 compatible. (this point I can handle for you if you want but it would be great if you could do it while you add the license headers) - One note on the code while taking a quick look: You used an ArrayList for the bounding box. Please consider using a java.awt.Rectangle instead. I hope you understand. Thank you very much!
Created attachment 23267 [details] java 1.4 compatible patch
Jeremias, it should be ok now. I have sent ICLA and CCLA licenses, the patch is now java 1.4 compatible, headers are included and Rectangle instead of Array is used.
Thank you, Jiri. I'll process your patch as soon as your ICLA is recorded. That could take a few days, though.
Jiri, your CLA still hasn't shown up. :-( How did you submit it? In the meantime, there have been a number of batches with CLAs but yours was not among them.
Jeremias, I sent it via email to secretary@apache.org, 14 days ago (17.2.2009), the subject was "FOP ICLA and CCLA". Should I send it again?
If it's no trouble for you, yes, please do. I'll talk to the secretary directly if it doesn't appear by next week. Thanks for your patience.
No problem Jeremias. I have sent it again.
Jiri, your ICLA (and the CCLA) has finally been recorded. I've also already taken the time to process the patch and applied it with modifications: http://svn.apache.org/viewvc?rev=752822&view=rev As you can see in the commit message, I found a bug concerning the anchor rectangle. I found that using the example I've just committed: http://svn.apache.org/viewvc?rev=752824&view=rev Another problem which I didn't realize earlier is that your changes violate the DSC specification. Here's the scenario: Create a PostScript document with two pages and use the same TexturePaint on both pages. Then extract the second page according to DSC rules and you get an invalid PostScript file (because it misses the pattern that is part of the first page). The example above demonstrates this. This is not catastrophic but it should be fixed at some point. This is why I'll leave this issue open for the time being. I think there are two approaches: 1. limit the reuse of tiling patterns to one page and ignore DSC for pattern resources. 2. Tie pattern resources into resource tracking. This will require changes in PSDocumentGraphics2D similar to what we do in Apache FOP: we create the PostScript file as a temporary file and create common resources in the setup part in a second pass. See: http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/ResourceHandler.java?view=markup Thanks for your patience, Jiri.
Hi Jeremias, I checked your changes about anchor rectangle in the code and I think you did it very well. But now I think, there is no reason to define the patterns in the ResourceHandler, because now every pattern is unique - because of the line "x y translate" in PaintProc - x and y will be always different (there is no reason to draw the same pattern (if I say the same pattern I mean the same binary data of pattern) on the same position (I mean the position which is specified by "x y translate") several times). So I decided to delete class PSPatternStorage, don't use the ResourceHandler and the pattern define directly on a page where is used.
Created attachment 23720 [details] Patterns will not violate DSC rules after using this patch This patch remove the class PSPaternStorage and all references to it. Patterns will not violate DSC rules, but now the same pattern can be defined more than one time on the page (document) => the size of the output file can be a bigger than it is necessary. The right solution would be to define pattern resources in the begin of the ps document, similarly how it is done for fonts and images.
Latest patch applied: http://svn.apache.org/viewvc?rev=804444&view=rev Thanks a lot, Jiří and sorry for the slow reaction time! Pattern generation now looks fine to me. I think that means we can close this issue here.