3 * @package php-font-lib
4 * @link https://github.com/PhenX/php-font-lib
5 * @author Fabien Ménager <fabien.menager@gmail.com>
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 $
9 namespace FontLib\Glyph;
11 use FontLib\Table\Type\glyf;
12 use FontLib\TrueType\File;
13 use FontLib\BinaryStream;
18 * @package php-font-lib
20 class Outline extends BinaryStream {
22 * @var \FontLib\Table\Type\glyf
30 public $numberOfContours;
45 static function init(glyf $table, $offset, $size, BinaryStream $font) {
48 if ($font->readInt16() > -1) {
49 /** @var OutlineSimple $glyph */
50 $glyph = new OutlineSimple($table, $offset, $size);
53 /** @var OutlineComposite $glyph */
54 $glyph = new OutlineComposite($table, $offset, $size);
66 return $this->table->getFont();
69 function __construct(glyf $table, $offset = null, $size = null) {
70 $this->table = $table;
71 $this->offset = $offset;
75 function parse(BinaryStream $font) {
76 $font->seek($this->offset);
82 $this->raw = $font->read($this->size);
85 function parseData() {
86 $font = $this->getFont();
87 $font->seek($this->offset);
89 $this->numberOfContours = $font->readInt16();
90 $this->xMin = $font->readFWord();
91 $this->yMin = $font->readFWord();
92 $this->xMax = $font->readFWord();
93 $this->yMax = $font->readFWord();
97 $font = $this->getFont();
99 return $font->write($this->raw, strlen($this->raw));
102 function getSVGContours() {
106 function getGlyphIDs() {