| Total Complexity | 12 |
| Total Lines | 97 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class ImageFont |
||
| 8 | { |
||
| 9 | const FONTTYPE_INTERNAL = 1; |
||
| 10 | const FONTTYPE_TTF = 2; |
||
| 11 | |||
| 12 | private $color; |
||
| 13 | private $text; |
||
| 14 | private $angle = 0; |
||
| 15 | private $size = 8; |
||
| 16 | private $fontType; |
||
| 17 | private $font; |
||
| 18 | private $image; |
||
|
|
|||
| 19 | |||
| 20 | public function __construct($text = '') |
||
| 21 | { |
||
| 22 | $this->text = $text; |
||
| 23 | } |
||
| 24 | |||
| 25 | public function font($fontFile) |
||
| 26 | { |
||
| 27 | if (is_int($fontFile)) { |
||
| 28 | $this->fontType = self::FONTTYPE_INTERNAL; |
||
| 29 | } else { |
||
| 30 | $this->fontType = self::FONTTYPE_TTF; |
||
| 31 | } |
||
| 32 | |||
| 33 | $this->font = $fontFile; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function size($size) |
||
| 37 | { |
||
| 38 | $this->size = $size; |
||
| 39 | |||
| 40 | return $this; |
||
| 41 | } |
||
| 42 | |||
| 43 | public function angle($angle) |
||
| 44 | { |
||
| 45 | $this->angle = $angle; |
||
| 46 | |||
| 47 | return $this; |
||
| 48 | } |
||
| 49 | |||
| 50 | public function color($color) |
||
| 53 | } |
||
| 54 | |||
| 55 | private function createColor($image) |
||
| 56 | { |
||
| 57 | return imagecolorallocate( |
||
| 58 | $image, |
||
| 59 | $this->color[0], |
||
| 60 | $this->color[1], |
||
| 61 | $this->color[2] |
||
| 62 | ); |
||
| 63 | } |
||
| 64 | |||
| 65 | public function align($align) |
||
| 66 | { |
||
| 67 | } |
||
| 68 | |||
| 69 | public function text($text) |
||
| 74 | } |
||
| 75 | |||
| 76 | public function valign($align) |
||
| 78 | } |
||
| 79 | |||
| 80 | public function apply(&$image, $x = 0, $y = 0) |
||
| 81 | { |
||
| 107 |