From 541701f5803c5005864efcb09a0c4aacecb470f9 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 8 Sep 2013 19:22:57 +0200 Subject: TiledPrintingAWTBase/doc: Add description of how-to add a 'print-to-file' printer driver on OSX --- .../test/junit/jogl/tile/TiledPrintingAWTBase.java | 46 ++++++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'src/test/com') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java index 50625d48c..ec216a95e 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java @@ -55,6 +55,38 @@ import com.jogamp.common.util.locks.LockFactory; import com.jogamp.common.util.locks.RecursiveLock; import com.jogamp.opengl.test.junit.util.UITestCase; +/** + * Base unit test class implementing {@link Printable}. + * + *
Scaling of Frame and GL content
+ *

+ * We fit the frame into the imageable area with for 72 dpi, + * assuming that is the default AWT painting density. + *

+ *

+ * The frame borders are considered. + *

+ *

+ * The frame's scale factor is used for the graphics print matrix + * of the overall print-job, hence no frame resize is required. + *

+ *

+ * The GL scale factor 'scaleGLMatXY', 72dpi/glDPI, is passed to the GL object + * which locally scales the print matrix and renders the scene with 1/scaleGLMatXY pixels. + *

+ *
Virtual printer driver
+ *

+ * Note, on OSX you might need to setup a dummy printer, i.e. print to file.
+ * As root: + *

+   cupsctl FileDevice=Yes
+   killall -HUP cupsd
+   mkdir /data/lp
+   chown USER /data/lp
+   chmod ugo+rwx /data/lp
+   lpadmin -p lprint -E -v file:/data/lp/out.ps -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 4\ Plus.gz
+ * 
+ */ public abstract class TiledPrintingAWTBase extends UITestCase implements Printable { public static final double MM_PER_INCH = 25.4; @@ -121,19 +153,7 @@ public abstract class TiledPrintingAWTBase extends UITestCase implements Printab System.err.println("PF: Page orientation "+pf.getOrientation()); /** - * We fit the frame into the imageable area with for 72 dpi, - * assuming that is the default AWT painting density. - *

- * The frame borders are considered. - *

- *

- * The frame's scale factor is used for the graphics print matrix - * of the overall print-job, hence no frame resize is required. - *

- *

- * The GL scale factor 'scaleGLMatXY', 72dpi/glDPI, is passed to the GL object - * which locally scales the print matrix and renders the scene with 1/scaleGLMatXY pixels. - *

+ * See: 'Scaling of Frame and GL content' in Class description! */ final Insets frameInsets = frame.getInsets(); final int frameWidth = frame.getWidth(); -- cgit v1.2.3