1 | <?php |
||
10 | class WidthCollection |
||
11 | { |
||
12 | /** |
||
13 | * Array containing character widths for each font & size. |
||
14 | * |
||
15 | * @var array |
||
16 | */ |
||
17 | private static $widths = array(); |
||
18 | |||
19 | /** |
||
20 | * Create character width map for each font. |
||
21 | */ |
||
22 | 13 | public function __construct() |
|
26 | |||
27 | /** |
||
28 | * Dirty way to allow developers to load character widths that |
||
29 | * are not yet included. |
||
30 | * |
||
31 | * @param string $csvPath |
||
32 | */ |
||
33 | 13 | public static function loadWidthsFromCsv($csvPath) |
|
44 | |||
45 | /** |
||
46 | * Return character widths for given font name. |
||
47 | * |
||
48 | * @param string $fontName |
||
49 | * @param int $fontSize |
||
50 | * @return array |
||
51 | */ |
||
52 | 4 | public function get($fontName, $fontSize) |
|
62 | } |
||
63 |