3 $size = 5 * $linewidth;
5 $width = 3*($pad +
$size) +
$pad;
6 $height = $pad +
$size +
$pad;
7 $sur = new CairoImageSurface(FORMAT_ARGB32
,$width, $height);
8 $con = new CairoContext($sur);
10 $con->setSourceRgb(1,1,1);
14 $con->setLineWidth($linewidth);
15 $con->translate($pad, $pad);
18 $con->relLineTo(0,$size);
19 $con->relLineTo($size,0);
22 $con->moveTo(2*$linewidth, 0);
23 $con->relLineTo(3*$linewidth, 0);
24 $con->relLineTo(0,3*$linewidth);
26 $con->setLineCap(LINE_CAP_BUTT
);
27 $con->setLineJoin(LINE_JOIN_BEVEL
);
30 $con->translate($size+
$pad, 0);
33 $con->relLineTo(0,$size);
34 $con->relLineTo($size,0);
37 $con->moveTo(2*$linewidth, 0);
38 $con->relLineTo(3*$linewidth, 0);
39 $con->relLineTo(0,3*$linewidth);
41 $con->setLineCap(LINE_CAP_ROUND
);
42 $con->setLineJoin(LINE_JOIN_ROUND
);
45 $con->translate($size+
$pad,0);
48 $con->relLineTo(0,$size);
49 $con->relLineTo($size,0);
52 $con->moveTo(2*$linewidth, 0);
53 $con->relLineTo(3*$linewidth, 0);
54 $con->relLineTo(0,3*$linewidth);
56 $con->setLineCap(LINE_CAP_SQUARE
);
57 $con->setLineJoin(LINE_JOIN_MITER
);
59 $sur->writeToPng("caps-joins-php.png");