| Total Complexity | 7 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Coverage | 86.36% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class FieldParserFixedText extends AbstractFieldParser implements FieldParserInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Increase Ciff's 'pitch' value to approximate size in pixels. |
||
| 11 | * |
||
| 12 | * @var float |
||
| 13 | */ |
||
| 14 | const FONT_SIZE_MULTIPLIER = 4.2; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | const DEFAULT_FONT_SIZE = 13; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @return float |
||
| 23 | */ |
||
| 24 | 1 | public function getFontSize() |
|
| 25 | { |
||
| 26 | 1 | $size = (float) $this->xmlField->Text->Font->Pitch; |
|
| 27 | 1 | if (!$size) { |
|
| 28 | $size = self::DEFAULT_FONT_SIZE; |
||
| 29 | } |
||
| 30 | |||
| 31 | 1 | return $size * self::FONT_SIZE_MULTIPLIER; |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return string |
||
| 36 | */ |
||
| 37 | 1 | public function getFontFace() |
|
| 38 | { |
||
| 39 | 1 | return (string) $this->xmlField->Text->Font->Face; |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return int |
||
| 44 | */ |
||
| 45 | 2 | public function getOrientation() |
|
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | 2 | public function getText() |
|
| 70 | } |
||
| 71 | } |
||
| 72 |