[cairo-commit] CairoJava/test/org/cairographics/cairo/test TestCairo.java,1.3,1.4

Soorya Kuloor commit at pdx.freedesktop.org
Tue Dec 23 09:37:17 PST 2003


Committed by: skuloor

Update of /cvs/cairo/CairoJava/test/org/cairographics/cairo/test
In directory pdx:/tmp/cvs-serv12085/test/org/cairographics/cairo/test

Modified Files:
	TestCairo.java 
Log Message:
Port to latest CairoJava

Index: TestCairo.java
===================================================================
RCS file: /cvs/cairo/CairoJava/test/org/cairographics/cairo/test/TestCairo.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** TestCairo.java	7 Aug 2003 20:43:38 -0000	1.3
--- TestCairo.java	23 Dec 2003 17:37:15 -0000	1.4
***************
*** 32,36 ****
  
  import org.cairographics.cairo.Cairo;
! 
  import org.eclipse.swt.events.PaintEvent;
  import org.eclipse.swt.events.PaintListener;
--- 32,36 ----
  
  import org.cairographics.cairo.Cairo;
! import org.cairographics.cairo.CairoFont;
  import org.eclipse.swt.events.PaintEvent;
  import org.eclipse.swt.events.PaintListener;
***************
*** 72,84 ****
          cairo.fill();
  
          cairo.save();
          cairo.setAlpha(1.0);
          cairo.moveTo(200, 200);
          cairo.setColor(0.0, 0.5, 0.3);
!         cairo.selectFont("Bitstream Vera Serif:normal:normal");
!         cairo.scaleFont(15.0);
!         cairo.showText("Hello how are you?");
!         //cairo.rect(200, 200-20, 400, 20, 0, 0);
!         //Xr.TextExtents ext = cairo.getTextExtents("Hello how are you?");
          cairo.stroke();
          cairo.restore();
--- 72,104 ----
          cairo.fill();
  
+         String msg = "Hello how are you?";
+         double fontSize = 10.0;
          cairo.save();
+         //cairo.rotate(0.3);
+         cairo.scale(1.2, 1.2);
          cairo.setAlpha(1.0);
          cairo.moveTo(200, 200);
          cairo.setColor(0.0, 0.5, 0.3);
!         cairo.selectFont(
!             "Bitstream Vera Sans",
!             CairoFont.SLANT_NORMAL,
!             CairoFont.WEIGHT_BOLD);
!         cairo.scaleFont(fontSize);
!         cairo.showText(msg);
!         double[] exts = cairo.getTextExtents(msg);
!         System.out.println(
!             "DEBUG: extents: ["
!                 + exts[0]
!                 + ", "
!                 + exts[1]
!                 + ", "
!                 + exts[2]
!                 + ", "
!                 + exts[3]
!                 + ", "
!                 + exts[4]
!                 + ", "
!                 + exts[5]);
!         cairo.rect(200 + exts[0], 200 + exts[1], exts[2], exts[3], 0, 0);
          cairo.stroke();
          cairo.restore();
***************
*** 89,92 ****
--- 109,113 ----
  
          cairo.restore();
+ 
          cairo.dispose();
  





More information about the cairo-commit mailing list