xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luis Bernardo <lmpmberna...@gmail.com>
Subject Re: SVG pixel size
Date Tue, 09 Jul 2013 22:46:28 GMT

Correct. And since FOP is still in the past and uses 72 instead of 96:

2.125 / 72 * 96 = 2.833 (pixels, which become dots when sent to the printer)

On 7/9/13 5:46 PM, Sergiu Dumitriu wrote:
> So, a pixel is a fixed length that doesn't scale down with the DPI, it
> should always be 1/96 inches. At 204 DPI that would translate into 2.125
> dots.
>
>
> On 07/09/2013 09:33 AM, Luis Bernardo wrote:
>> Lets look at the default case, that creates a 100x100 pixel image. The
>> default target dpi is 72, so 100/72 = 1.388888.
>>
>> If you set the target dpi to 204, then the image needs to be 283x283
>> pixels because 204*1.38888 = 283.3333. Then a 1 pixel line needs to be
>> 2.83 pixels to keep the scaling correct. Since you cannot have 2.83
>> pixel thickness in the monitor, it defaults to 3 pixels.
>>
>> Is your goal to print (to paper) a line of a certain thickness? Then you
>> need to talk about dimensions (say, mm) not pixels.
>>
>>
>>
>> On Tue, Jul 9, 2013 at 1:35 PM, Massimo <massimo.iasevoli@snai.it
>> <mailto:massimo.iasevoli@snai.it>> 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://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>
>>
>


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


Mime
View raw message