ngeorga / flying-saucer

Automatically exported from code.google.com/p/flying-saucer
0 stars 0 forks source link

CSS regress tests should be run at 96dpi #53

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
*** This issue was imported from http://java.net/jira/browse/XHTMLRENDERER-306

It was reported by bago on 10.01.2010 20:50:05 +0100 and last updated in the 
previous bug tracker on 11.01.2010 09:21:18 +0100

Found in
Operating System: All
Platform: All

The priority for this issue at migration was Major.

Original description: 
It seems that FS sets the default DPI to 72 in SharedContext using a constant, 
only when it is not possible to retrieve the toolkit DPI.

But, most FS code, will override the "internally calculated" SharedContext DPI, 
using 72 DPI hardcoded.

ITextRenderer constructor, BoxRenderer.newSharedContext, Java2DRenderer.init 
are 
3 places where context.setDPI(72 * dotsPerPoint) is called.

If I change them to 96 many regress tests output the correct result:
t0803-c5501-mrgn-t-00-b-a.xhtml [FIXED]
t0803-c5502-mrgn-r-00-c-ag.xhtml [FIXED]
t0803-c5503-mrgn-b-00-b-a.xhtml [FIXED]
t0803-c5504-mrgn-l-00-c-ag.xhtml [FIXED]
t0803-c5505-mrgn-b-ag.xhtml [IMPROVED]
t0803-c5506-padn-t-00-b-a.xhtml [FIXED]
t0803-c5507-padn-r-00-c-ag.xhtml [FIXED]
t0803-c5508-ipadn-b-03-b-a.xhtml [FIXED]
t0803-c5509-padn-l-00-b-ag.xhtml [FIXED]
t0804-c5510-padn-00-b-ag.xhtml [FIXED]
t100801-c548-ln-ht-00-c-a.xhtml [FIXED]
t100801-c548-ln-ht-01-b-ag.xhtml [FIXED]
t1507-c526-font-sz-01-b-a.xhtml [FIXED]
t1508-c527-font-07-b.xhtml [FIXED]
t1601-c547-indent-00-b-a.xhtml [FIXED]

Is there a reason FS uses 72 as the default for Java2D, BoxRenderer and IText 
renderer?

Original issue reported on code.google.com by pdoubl...@gmail.com on 16 Feb 2011 at 9:47

GoogleCodeExporter commented 8 years ago
peterbrant wrote on 11.01.2010 02:52:28 +0100:
There are always 72 points in an inch.  That's the origin of the hardcoded 72.

At the same time, we shouldn't be overwriting the toolkit DPI if we have it
(i.e. for Java2D dotsPerPoint should be 1 and DPI should be the toolkit DPI).

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:47

GoogleCodeExporter commented 8 years ago
bago wrote on 11.01.2010 09:21:18 +0100:
So, how do you think we should deal with the CSS suite that specify the tests 
should be run at 96dpi?
http://www.w3.org/Style/CSS/Test/CSS2.1/current/

Should we pass 1,33333333 as the dotsPerPoint value? Or should we change the 
renderers to be able to get the dpi as argument?

Original comment by pdoubl...@gmail.com on 16 Feb 2011 at 9:47