| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package php-svg-lib |
| 4 |
* @link http://github.com/dompdf/php-svg-lib |
| 5 |
* @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace Svg\Surface; |
| 9 |
|
| 10 |
use Svg\Style; |
| 11 |
|
| 12 |
/** |
| 13 |
* Interface Surface, like CanvasRenderingContext2D |
| 14 |
* |
| 15 |
* @package Svg |
| 16 |
*/ |
| 17 |
interface SurfaceInterface |
| 18 |
{ |
| 19 |
public function save(); |
| 20 |
|
| 21 |
public function restore(); |
| 22 |
|
| 23 |
// transformations (default transform is the identity matrix) |
| 24 |
public function scale($x, $y); |
| 25 |
|
| 26 |
public function rotate($angle); |
| 27 |
|
| 28 |
public function translate($x, $y); |
| 29 |
|
| 30 |
public function transform($a, $b, $c, $d, $e, $f); |
| 31 |
|
| 32 |
// path ends |
| 33 |
public function beginPath(); |
| 34 |
|
| 35 |
public function closePath(); |
| 36 |
|
| 37 |
public function fill(); |
| 38 |
|
| 39 |
public function stroke(bool $close = false); |
| 40 |
|
| 41 |
public function endPath(); |
| 42 |
|
| 43 |
public function fillStroke(bool $close = false); |
| 44 |
|
| 45 |
public function clip(); |
| 46 |
|
| 47 |
// text (see also the CanvasDrawingStyles interface) |
| 48 |
public function fillText($text, $x, $y, $maxWidth = null); |
| 49 |
|
| 50 |
public function strokeText($text, $x, $y, $maxWidth = null); |
| 51 |
|
| 52 |
public function measureText($text); |
| 53 |
|
| 54 |
// drawing images |
| 55 |
public function drawImage($image, $sx, $sy, $sw = null, $sh = null, $dx = null, $dy = null, $dw = null, $dh = null); |
| 56 |
|
| 57 |
// paths |
| 58 |
public function lineTo($x, $y); |
| 59 |
|
| 60 |
public function moveTo($x, $y); |
| 61 |
|
| 62 |
public function quadraticCurveTo($cpx, $cpy, $x, $y); |
| 63 |
|
| 64 |
public function bezierCurveTo($cp1x, $cp1y, $cp2x, $cp2y, $x, $y); |
| 65 |
|
| 66 |
public function arcTo($x1, $y1, $x2, $y2, $radius); |
| 67 |
|
| 68 |
public function circle($x, $y, $radius); |
| 69 |
|
| 70 |
public function arc($x, $y, $radius, $startAngle, $endAngle, $anticlockwise = false); |
| 71 |
|
| 72 |
public function ellipse($x, $y, $radiusX, $radiusY, $rotation, $startAngle, $endAngle, $anticlockwise); |
| 73 |
|
| 74 |
// Rectangle |
| 75 |
public function rect($x, $y, $w, $h, $rx = 0, $ry = 0); |
| 76 |
|
| 77 |
public function fillRect($x, $y, $w, $h); |
| 78 |
|
| 79 |
public function strokeRect($x, $y, $w, $h); |
| 80 |
|
| 81 |
public function setStyle(Style $style); |
| 82 |
|
| 83 |
/** |
| 84 |
* @return Style |
| 85 |
*/ |
| 86 |
public function getStyle(); |
| 87 |
|
| 88 |
public function setFont($family, $style, $weight); |
| 89 |
} |
| 90 |
|