1 | <?php |
||
11 | class FontsFactory |
||
12 | { |
||
13 | /** @var string|array */ |
||
14 | private $fontsPath; |
||
15 | |||
16 | /** @var array */ |
||
17 | protected $fonts = array(); |
||
18 | |||
19 | /** |
||
20 | * @param string|array $fontsPath string to scan directory with .ttf file extension or array with full path to each font |
||
21 | */ |
||
22 | 12 | protected function __construct($fontsPath) |
|
27 | |||
28 | /** |
||
29 | * @param string|array $fontsPath string to scan directory with .ttf file extension or array with full path to each font |
||
30 | * @return FontsFactory |
||
31 | */ |
||
32 | 12 | public static function create($fontsPath) |
|
36 | |||
37 | 12 | public function loadFonts() |
|
49 | |||
50 | /** |
||
51 | * @param string $name |
||
52 | * @return Font |
||
53 | * @throws \InvalidArgumentException |
||
54 | */ |
||
55 | 11 | public function getFont($name) |
|
60 | |||
61 | /** |
||
62 | * @param string $name |
||
63 | * @param int $size |
||
64 | * @param string $color |
||
65 | * @return ImagineFont |
||
66 | */ |
||
67 | 11 | public function getImagineFont($name, $size, $color = '#000000') |
|
72 | |||
73 | /** |
||
74 | * @return array |
||
75 | */ |
||
76 | public function getFonts() |
||
80 | } |
||
81 |