1<?php declare(strict_types=1); 2 3namespace PrinsFrank\PdfParser\Document\Font; 4 5readonly class FontWidths { 6 /** @param list<float> $widths */ 7 public function __construct( 8 public int $firstChar, 9 public array $widths, 10 ) {} 11 12 public function getWidthForCharacter(int $characterCode): ?float { 13 return $this->widths[$characterCode - $this->firstChar] ?? null; 14 } 15} 16