PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.2.7
Yatra – Travel Booking & Tour Operator Software v3.0.2.7
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / vendor / phenx / php-font-lib / src / FontLib / Glyph / Outline.php

Outline.php in Yatra – Travel Booking & Tour Operator Software 3.0.2.7, at vendor/phenx/php-font-lib/src/FontLib/Glyph/Outline.php

110 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package php-font-lib
4 * @link https://github.com/dompdf/php-font-lib
5 * @author Fabien Ménager <[email protected]>
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 FontLib\Glyph;
10
11 use FontLib\Table\Type\glyf;
12 use FontLib\TrueType\File;
13 use FontLib\BinaryStream;
14
15 /**
16 * `glyf` font table.
17 *
18 * @package php-font-lib
19 */
20 class Outline extends BinaryStream {
21 /**
22 * @var \FontLib\Table\Type\glyf
23 */
24 protected $table;
25
26 protected $offset;
27 protected $size;
28
29 // Data
30 public $numberOfContours;
31 public $xMin;
32 public $yMin;
33 public $xMax;
34 public $yMax;
35
36 /**
37 * @var string|null
38 */
39 public $raw;
40
41 /**
42 * @param glyf $table
43 * @param $offset
44 * @param $size
45 *
46 * @return Outline
47 */
48 static function init(glyf $table, $offset, $size, BinaryStream $font) {
49 $font->seek($offset);
50
51 if ($size === 0 || $font->readInt16() > -1) {
52 /** @var OutlineSimple $glyph */
53 $glyph = new OutlineSimple($table, $offset, $size);
54 }
55 else {
56 /** @var OutlineComposite $glyph */
57 $glyph = new OutlineComposite($table, $offset, $size);
58 }
59
60 $glyph->parse($font);
61
62 return $glyph;
63 }
64
65 /**
66 * @return File
67 */
68 function getFont() {
69 return $this->table->getFont();
70 }
71
72 function __construct(glyf $table, $offset = null, $size = null) {
73 $this->table = $table;
74 $this->offset = $offset;
75 $this->size = $size;
76 }
77
78 function parse(BinaryStream $font) {
79 $font->seek($this->offset);
80
81 $this->raw = $font->read($this->size);
82 }
83
84 function parseData() {
85 $font = $this->getFont();
86 $font->seek($this->offset);
87
88 $this->numberOfContours = $font->readInt16();
89 $this->xMin = $font->readFWord();
90 $this->yMin = $font->readFWord();
91 $this->xMax = $font->readFWord();
92 $this->yMax = $font->readFWord();
93 }
94
95 function encode() {
96 $font = $this->getFont();
97
98 return $font->write($this->raw, mb_strlen((string) $this->raw, '8bit'));
99 }
100
101 function getSVGContours() {
102 // Inherit
103 }
104
105 function getGlyphIDs() {
106 return array();
107 }
108 }
109
110