Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
FontMatch
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\HtmlToPdf\Layout;
6
7/**
8 * Result of {@see FontResolver::resolveMatch()}: the chosen {@see FontFace}
9 * plus per-axis match flags so consumers know whether the face fully
10 * satisfies the requested weight / style or only partially (e.g. the
11 * resolver picked the closest 400-normal face for a `font-weight: 700`
12 * request because no bold face was registered).
13 *
14 * The painter uses the flags to decide whether to apply the synthetic
15 * fake-bold (text mode 2 stroke) and fake-italic (skewed text matrix)
16 * fallbacks. A `false` flag triggers the synthetic effect; a `true` flag
17 * skips it so the real face's shape isn't double-bolded / double-skewed.
18 */
19final readonly class FontMatch
20{
21    public function __construct(
22        public FontFace $face,
23        public bool $matchesWeight,
24        public bool $matchesStyle,
25    ) {}
26}