Keine Beschreibung

nameRecord.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. use FontLib\Font;
  10. use FontLib\BinaryStream;
  11. /**
  12. * Font table name record.
  13. *
  14. * @package php-font-lib
  15. */
  16. class nameRecord extends BinaryStream {
  17. public $platformID;
  18. public $platformSpecificID;
  19. public $languageID;
  20. public $nameID;
  21. public $length;
  22. public $offset;
  23. public $string;
  24. public static $format = array(
  25. "platformID" => self::uint16,
  26. "platformSpecificID" => self::uint16,
  27. "languageID" => self::uint16,
  28. "nameID" => self::uint16,
  29. "length" => self::uint16,
  30. "offset" => self::uint16,
  31. );
  32. public function map($data) {
  33. foreach ($data as $key => $value) {
  34. $this->$key = $value;
  35. }
  36. }
  37. public function getUTF8() {
  38. return $this->string;
  39. }
  40. public function getUTF16() {
  41. return Font::UTF8ToUTF16($this->string);
  42. }
  43. function __toString() {
  44. return $this->string;
  45. }
  46. }