PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.2
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.2
1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
woocommerce-pos / vendor_prefixed / dompdf / php-font-lib / src / FontLib / Glyph / Outline.php

Outline.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.2, at vendor_prefixed/dompdf/php-font-lib/src/FontLib/Glyph/Outline.php

99 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @package php-font-lib
5 * @link https://github.com/dompdf/php-font-lib
6 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
7 * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $
8 */
9 namespace WCPOS\Vendor\FontLib\Glyph;
10
11 use WCPOS\Vendor\FontLib\Table\Type\glyf;
12 use WCPOS\Vendor\FontLib\TrueType\File;
13 use WCPOS\Vendor\FontLib\BinaryStream;
14 /**
15 * `glyf` font table.
16 *
17 * @package php-font-lib
18 */
19 class Outline extends BinaryStream
20 {
21 /**
22 * @var \FontLib\Table\Type\glyf
23 */
24 protected $table;
25 protected $offset;
26 protected $size;
27 // Data
28 public $numberOfContours;
29 public $xMin;
30 public $yMin;
31 public $xMax;
32 public $yMax;
33 /**
34 * @var string|null
35 */
36 public $raw;
37 /**
38 * @param glyf $table
39 * @param $offset
40 * @param $size
41 *
42 * @return Outline
43 */
44 static function init(glyf $table, $offset, $size, BinaryStream $font)
45 {
46 $font->seek($offset);
47 if ($size === 0 || $font->readInt16() > -1) {
48 /** @var OutlineSimple $glyph */
49 $glyph = new OutlineSimple($table, $offset, $size);
50 } else {
51 /** @var OutlineComposite $glyph */
52 $glyph = new OutlineComposite($table, $offset, $size);
53 }
54 $glyph->parse($font);
55 return $glyph;
56 }
57 /**
58 * @return File
59 */
60 function getFont()
61 {
62 return $this->table->getFont();
63 }
64 function __construct(glyf $table, $offset = null, $size = null)
65 {
66 $this->table = $table;
67 $this->offset = $offset;
68 $this->size = $size;
69 }
70 function parse(BinaryStream $font)
71 {
72 $font->seek($this->offset);
73 $this->raw = $font->read($this->size);
74 }
75 function parseData()
76 {
77 $font = $this->getFont();
78 $font->seek($this->offset);
79 $this->numberOfContours = $font->readInt16();
80 $this->xMin = $font->readFWord();
81 $this->yMin = $font->readFWord();
82 $this->xMax = $font->readFWord();
83 $this->yMax = $font->readFWord();
84 }
85 function encode()
86 {
87 $font = $this->getFont();
88 return $font->write($this->raw, \mb_strlen((string) $this->raw, '8bit'));
89 }
90 function getSVGContours()
91 {
92 // Inherit
93 }
94 function getGlyphIDs()
95 {
96 return array();
97 }
98 }
99