Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / phenx / php-font-lib / src / FontLib / Table / Type / nameRecord.php
1 <?php
2 /**
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  */
8 namespace FontLib\Table\Type;
9
10 use FontLib\Font;
11 use FontLib\BinaryStream;
12
13 /**
14  * Font table name record.
15  *
16  * @package php-font-lib
17  */
18 class nameRecord extends BinaryStream {
19   public $platformID;
20   public $platformSpecificID;
21   public $languageID;
22   public $nameID;
23   public $length;
24   public $offset;
25   public $string;
26
27   public static $format = array(
28     "platformID"         => self::uint16,
29     "platformSpecificID" => self::uint16,
30     "languageID"         => self::uint16,
31     "nameID"             => self::uint16,
32     "length"             => self::uint16,
33     "offset"             => self::uint16,
34   );
35
36   public function map($data) {
37     foreach ($data as $key => $value) {
38       $this->$key = $value;
39     }
40   }
41
42   public function getUTF8() {
43     return $this->string;
44   }
45
46   public function getUTF16() {
47     return Font::UTF8ToUTF16($this->string);
48   }
49
50   function __toString() {
51     return $this->string;
52   }
53 }