Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions
Zend_Pdf_FileParser_Font Class Reference
Inheritance diagram for Zend_Pdf_FileParser_Font:
Zend_Pdf_FileParser Zend_Pdf_FileParser_Font_OpenType Zend_Pdf_FileParser_Font_OpenType_TrueType

Public Member Functions

 __construct (Zend_Pdf_FileParserDataSource $dataSource)
 
 __get ($property)
 
 readStringUTF16 ($byteCount, $byteOrder=Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN, $characterSet='')
 
 readStringMacRoman ($byteCount, $characterSet='')
 
 readStringPascal ($characterSet='', $lengthBytes=1)
 
 writeDebug ()
 
 __set ($property, $value)
 
- Public Member Functions inherited from Zend_Pdf_FileParser
 screen ()
 
 parse ()
 
 __construct (Zend_Pdf_FileParserDataSource $dataSource)
 
 __destruct ()
 
 isScreened ()
 
 isParsed ()
 
 getDataSource ()
 
 moveToOffset ($offset)
 
 getOffset ()
 
 getSize ()
 
 readBytes ($byteCount)
 
 skipBytes ($byteCount)
 
 readInt ($size, $byteOrder=Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN)
 
 readUInt ($size, $byteOrder=Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN)
 
 isBitSet ($bit, $bitField)
 
 readFixed ($mantissaBits, $fractionBits, $byteOrder=Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN)
 
 readStringUTF16 ($byteCount, $byteOrder=Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN, $characterSet='')
 
 readStringMacRoman ($byteCount, $characterSet='')
 
 readStringPascal ($characterSet='', $lengthBytes=1)
 

Protected Member Functions

 _debugLog ($message)
 

Additional Inherited Members

- Data Fields inherited from Zend_Pdf_FileParser
const BYTE_ORDER_LITTLE_ENDIAN = 0
 
const BYTE_ORDER_BIG_ENDIAN = 1
 
- Protected Attributes inherited from Zend_Pdf_FileParser
 $_isScreened = false
 
 $_isParsed = false
 
 $_dataSource = null
 

Detailed Description

Definition at line 42 of file Font.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( Zend_Pdf_FileParserDataSource  $dataSource)

Object constructor.

Validates the data source and enables debug logging if so configured.

Parameters
Zend_Pdf_FileParserDataSource$dataSource
Exceptions
Zend_Pdf_Exception

Definition at line 75 of file Font.php.

76  {
77  parent::__construct($dataSource);
78  $this->fontType = Zend_Pdf_Font::TYPE_UNKNOWN;
79  }
const TYPE_UNKNOWN
Definition: Font.php:49

Member Function Documentation

◆ __get()

__get (   $property)

Get handler

Parameters
string$property
Returns
mixed

Definition at line 90 of file Font.php.

91  {
92  if (isset($this->_fontProperties[$property])) {
93  return $this->_fontProperties[$property];
94  } else {
95  return null;
96  }
97  }

◆ __set()

__set (   $property,
  $value 
)

Set handler

NOTE: This method is protected. Other classes may freely interrogate the font properties, but only this and its subclasses may set them.

Parameters
string$property
mixed$value

Definition at line 181 of file Font.php.

182  {
183  if ($value === null) {
184  unset($this->_fontProperties[$property]);
185  } else {
186  $this->_fontProperties[$property] = $value;
187  }
188  }
$value
Definition: gender.phtml:16

◆ _debugLog()

_debugLog (   $message)
protected

If debug logging is enabled, writes the log message.

The log message is a sprintf() style string and any number of arguments may accompany it as additional parameters.

Parameters
string$message
mixed(optional, multiple) Additional arguments

Definition at line 202 of file Font.php.

203  {
204  if (! $this->_debug) {
205  return;
206  }
207  if (func_num_args() > 1) {
208  $args = func_get_args();
209  $message = array_shift($args);
210  $message = vsprintf($message, $args);
211  }
212 
213  #require_once 'Zend/Log.php';
214  $logger = new Zend_Log();
216  }
const DEBUG
Definition: Log.php:49
$message
$logger

◆ readStringMacRoman()

readStringMacRoman (   $byteCount,
  $characterSet = '' 
)

Reads the Mac Roman-encoded string from the binary file at the current offset location. Overridden to fix return character set at UTF-16BE.

Parameters
integer$byteCountNumber of bytes (characters) to return.
string$characterSet(optional) –Ignored–
Returns
string
Exceptions
Zend_Pdf_Exception

Definition at line 134 of file Font.php.

135  {
136  return parent::readStringMacRoman($byteCount, 'UTF-16BE');
137  }

◆ readStringPascal()

readStringPascal (   $characterSet = '',
  $lengthBytes = 1 
)

Reads the Pascal string from the binary file at the current offset location. Overridden to fix return character set at UTF-16BE.

Parameters
string$characterSet(optional) –Ignored–
integer$lengthBytes(optional) Number of bytes that make up the length. Default is 1.
Returns
string
Exceptions
Zend_Pdf_Exception

Definition at line 149 of file Font.php.

150  {
151  return parent::readStringPascal('UTF-16BE');
152  }

◆ readStringUTF16()

readStringUTF16 (   $byteCount,
  $byteOrder = Zend_Pdf_FileParser::BYTE_ORDER_BIG_ENDIAN,
  $characterSet = '' 
)

Reads the Unicode UTF-16-encoded string from the binary file at the current offset location. Overridden to fix return character set at UTF-16BE.

Todo:
Deal with to-dos in the parent method.
Parameters
integer$byteCountNumber of bytes (characters * 2) to return.
integer$byteOrder(optional) Big- or little-endian byte order. Use the BYTE_ORDER_ constants defined in Zend_Pdf_FileParser. If omitted, uses big-endian.
string$characterSet(optional) –Ignored–
Returns
string
Exceptions
Zend_Pdf_Exception

Definition at line 118 of file Font.php.

121  {
122  return parent::readStringUTF16($byteCount, $byteOrder, 'UTF-16BE');
123  }

◆ writeDebug()

writeDebug ( )

Writes the entire font properties array to STDOUT. Used only for debugging.

Definition at line 160 of file Font.php.

161  {
162  print_r($this->_fontProperties);
163  }

The documentation for this class was generated from the following file: