| 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 | 5 | 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 | 5 | public static function loadWidthsFromCsv($csvPath) |
|
| 43 | |||
| 44 | /** |
||
| 45 | * Return character widths for given font name. |
||
| 46 | * |
||
| 47 | * @param string $fontName |
||
| 48 | * @param int $fontSize |
||
| 49 | * @return array |
||
| 50 | */ |
||
| 51 | 2 | public function get($fontName, $fontSize) |
|
| 59 | } |
||
| 60 |