Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
CIDSystemInfo
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 toPdf
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\Pdf\Core\Font;
6
7use Phpdftk\Pdf\Core\PdfDictionary;
8use Phpdftk\Pdf\Core\PdfNumber;
9use Phpdftk\Pdf\Core\PdfString;
10use Phpdftk\Pdf\Core\PdfVersion;
11use Phpdftk\Pdf\Core\RequiresPdfVersion;
12use Phpdftk\Pdf\Core\Serializable;
13
14/**
15 * CIDSystemInfo dictionary.
16 *
17 * Identifies the character collection used by a CIDFont or CMap stream.
18 * All three fields are required.
19 *
20 * Example:
21 *   $info = new CIDSystemInfo('Adobe', 'Identity', 0);
22 *   $cidFont->cidSystemInfo = $info;
23 */
24#[RequiresPdfVersion(PdfVersion::V1_2)]
25class CIDSystemInfo implements Serializable
26{
27    public PdfString $registry;    // /Registry - issuer of the character collection
28    public PdfString $ordering;    // /Ordering - identifies the collection within the registry
29    public PdfNumber $supplement;  // /Supplement - supplement number (0 for the base collection)
30
31    public function __construct(string $registry, string $ordering, int $supplement)
32    {
33        $this->registry   = new PdfString($registry);
34        $this->ordering   = new PdfString($ordering);
35        $this->supplement = new PdfNumber($supplement);
36    }
37
38    public function toPdf(): string
39    {
40        $dict = new PdfDictionary();
41        $dict->set('Registry', $this->registry);
42        $dict->set('Ordering', $this->ordering);
43        $dict->set('Supplement', $this->supplement);
44
45        return $dict->toPdf();
46    }
47}