xref: /plugin/totext/vendor/prinsfrank/pdfparser/src/Document/Font/FontWidths.php (revision 0fbee1892eb8b7339ce48e27e48e3fc821a8695f)
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