2 function spline_path ()
10 - $spline / 4, - $spline,
17 function scale_then_set_line_width_and_stroke ()
19 global $con,$xscale,$yscale,$linewidth;
20 $con->scale ( $xscale, $yscale);
21 $con->setLineWidth ( $linewidth);
26 function scale_path_and_line_width ()
28 global $con, $xscale, $yscale,$linewidth;
31 $con->scale ( $xscale, $yscale);
38 $con->scale ( $xscale, $yscale);
39 $con->setLineWidth ( $linewidth);
45 function set_line_width_then_scale_and_stroke()
47 global $con, $xscale, $yscale,$linewidth;
48 $con->setLineWidth ( $linewidth);
49 $con->scale ( $xscale, $yscale);
54 function scale_path_not_line_width ()
56 global $con, $xscale, $yscale,$linewidth;
60 $con->scale ( $xscale, $yscale);
67 $con->setLineWidth ( $linewidth);
77 $width = ($xscale * $spline * 6.0);
78 $height = ($yscale * $spline * 2.0);
79 $sur = new CairoImageSurface(FORMAT_ARGB32
, $width, $height);
80 $con = new CairoContext($sur);
81 $con->setSourceRgb ( 1.0, 1.0, 1.0); /* white */
83 $con->setSourceRgb ( 0.0, 0.0, 0.0); /* black */
84 for($i =0 ; $i<4;$i++
) {
86 // $con->translate($width/4 + ($i % 2)*$width/2, $height/4 + ($i/2)*$height/2);
89 $con->translate($width/4 , $height/4);
90 scale_then_set_line_width_and_stroke();
93 $con->translate($width/4 +
$width/2, $height/4);
94 scale_path_and_line_width();
97 $con->translate($width/4, $height/4 +
$height/2);
98 set_line_width_then_scale_and_stroke();
101 $con->translate($width/4 +
$width/2, $height/4 +
$height/2);
102 scale_path_not_line_width();
107 $sur->writeToPng("line-width-scale-php.png");