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