Hi Massimo,

the easiest is to have the source resolution match the target
resolution. That way, one pixel in your source will become 1 pixel in
the output.

That said, if you want a real one-pixel line and not something
anti-aliased you have to ensure that the coordinates will match output
pixels. Start by setting the font-size on the outer block to 0, in order
to avoid that the baseline ends up somewhere in between two pixels.
Then, for some reason, you have to set the y pixels to half values. For
example, 1.5px. I haven’t investigated why.

HTH,
Vincent


On 09/07/13 14:35, Massimo wrote:
> Thanks for the answer.
> 
> I try to better explain the problem with an attached java example.
> 
> If you run the main method you should get two png image
> . svgDefImage.png that contain a 1px thin line generated with default target
> resolution
> . svg204Image.png that contain a 3px thin line generated with 204dpi target
> resolution
> 
> According to the svg tag, both files should contain 1px thin lines.
> 
> All images is generated with the same attached fo file.
> 
> Notice that I use a custom Java2D renderer.
> 
> I forgot to mention that I am using the fop trunk version.
> 
> Thanks.
> Massimo.
> 
> SVGTest.java
> <http://apache-fop.1065347.n5.nabble.com/file/n38858/SVGTest.java>  
> svgpixelsize.fo
> <http://apache-fop.1065347.n5.nabble.com/file/n38858/svgpixelsize.fo>  
> svgDefImage.png
> <http://apache-fop.1065347.n5.nabble.com/file/n38858/svgDefImage.png>  
> svg204Image.png
> <http://apache-fop.1065347.n5.nabble.com/file/n38858/svg204Image.png>  
> 
> 
> 
> --
> View this message in context: 
> http://apache-fop.1065347.n5.nabble.com/SVG-pixel-size-tp38853p38858.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

Reply via email to