diff --git a/framework/library/FontLib/AdobeFontMetrics.php b/framework/library/FontLib/AdobeFontMetrics.php index 30257f71..e75385f5 100644 --- a/framework/library/FontLib/AdobeFontMetrics.php +++ b/framework/library/FontLib/AdobeFontMetrics.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib; @@ -35,7 +35,7 @@ function write($file, $encoding = null) { $encoding = preg_replace("/[^a-z0-9-_]/", "", $encoding); $map_file = dirname(__FILE__) . "/../maps/$encoding.map"; if (!file_exists($map_file)) { - throw new \Exception("Unkown encoding ($encoding)"); + throw new \Exception("Unknown encoding ($encoding)"); } $map = new EncodingMap($map_file); @@ -139,7 +139,7 @@ function write($file, $encoding = null) { $this->endSection("CharMetrics"); $kern = $font->getData("kern", "subtable"); - $tree = $kern["tree"]; + $tree = is_array($kern) ? $kern["tree"] : null; if (!$encoding && is_array($tree)) { $this->startSection("KernData"); diff --git a/framework/library/FontLib/Autoloader.php b/framework/library/FontLib/Autoloader.php index eae69866..cd305453 100644 --- a/framework/library/FontLib/Autoloader.php +++ b/framework/library/FontLib/Autoloader.php @@ -2,8 +2,8 @@ /** * @package php-font-lib * @link https://github.com/PhenX/php-font-lib - * @author Fabien M�nager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @author Fabien Ménager + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib; diff --git a/framework/library/FontLib/BinaryStream.php b/framework/library/FontLib/BinaryStream.php index 46452fd2..c7eb52f8 100644 --- a/framework/library/FontLib/BinaryStream.php +++ b/framework/library/FontLib/BinaryStream.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib; @@ -63,7 +63,7 @@ public function load($filename) { */ public function open($filename, $mode = self::modeRead) { if (!in_array($mode, array(self::modeRead, self::modeWrite, self::modeReadWrite))) { - throw new \Exception("Unkown file open mode"); + throw new \Exception("Unknown file open mode"); } $this->f = fopen($filename, $mode); @@ -137,12 +137,17 @@ public function skip($n) { fseek($this->f, $n, SEEK_CUR); } + /** + * @param int $n The number of bytes to read + * + * @return string + */ public function read($n) { if ($n < 1) { return ""; } - return fread($this->f, $n); + return (string) fread($this->f, $n); } public function write($data, $length = null) { @@ -282,7 +287,7 @@ public function readLongDateTime() { $date = 0; } - return strftime("%Y-%m-%d %H:%M:%S", $date); + return date("Y-m-d H:i:s", $date); } public function writeLongDateTime($data) { diff --git a/framework/library/FontLib/EOT/File.php b/framework/library/FontLib/EOT/File.php index 881fae1c..f51d876c 100644 --- a/framework/library/FontLib/EOT/File.php +++ b/framework/library/FontLib/EOT/File.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\EOT; @@ -61,22 +61,21 @@ function parse() { // TODO Read font data ... } - /** - * Little endian version of the read method - * - * @param int $n The number of bytes to read - * - * @return string - */ + /** + * Little endian version of the read method + * + * @param int $n The number of bytes to read + * + * @return string + */ public function read($n) { if ($n < 1) { return ""; } - $string = fread($this->f, $n); - $chunks = str_split($string, 2); + $string = (string) fread($this->f, $n); + $chunks = mb_str_split($string, 2, '8bit'); $chunks = array_map("strrev", $chunks); - return implode("", $chunks); } diff --git a/framework/library/FontLib/EOT/Header.php b/framework/library/FontLib/EOT/Header.php index 83312464..960e36ad 100644 --- a/framework/library/FontLib/EOT/Header.php +++ b/framework/library/FontLib/EOT/Header.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\EOT; diff --git a/framework/library/FontLib/EncodingMap.php b/framework/library/FontLib/EncodingMap.php index be36ff6a..2acdebc5 100644 --- a/framework/library/FontLib/EncodingMap.php +++ b/framework/library/FontLib/EncodingMap.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib; diff --git a/framework/library/FontLib/Font.php b/framework/library/FontLib/Font.php index 47c13436..e13a6533 100644 --- a/framework/library/FontLib/Font.php +++ b/framework/library/FontLib/Font.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib; @@ -28,7 +28,7 @@ public static function load($file) { throw new FontNotFoundException($file); } - $header = file_get_contents($file, false, null, null, 4); + $header = file_get_contents($file, false, null, 0, 4); $class = null; switch ($header) { diff --git a/framework/library/FontLib/Glyph/Outline.php b/framework/library/FontLib/Glyph/Outline.php index 8663dd75..639ff60a 100644 --- a/framework/library/FontLib/Glyph/Outline.php +++ b/framework/library/FontLib/Glyph/Outline.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $ */ namespace FontLib\Glyph; @@ -33,6 +33,9 @@ class Outline extends BinaryStream { public $xMax; public $yMax; + /** + * @var string|null + */ public $raw; /** @@ -75,11 +78,7 @@ function __construct(glyf $table, $offset = null, $size = null) { function parse(BinaryStream $font) { $font->seek($this->offset); - if (!$this->size) { - return; - } - - $this->raw = $font->read($this->size); + $this->raw = $font->read($this->size); } function parseData() { @@ -96,7 +95,7 @@ function parseData() { function encode() { $font = $this->getFont(); - return $font->write($this->raw, strlen($this->raw)); + return $font->write($this->raw, mb_strlen((string) $this->raw, '8bit')); } function getSVGContours() { diff --git a/framework/library/FontLib/Glyph/OutlineComponent.php b/framework/library/FontLib/Glyph/OutlineComponent.php index d7d557de..9cafaf4d 100644 --- a/framework/library/FontLib/Glyph/OutlineComponent.php +++ b/framework/library/FontLib/Glyph/OutlineComponent.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $ */ diff --git a/framework/library/FontLib/Glyph/OutlineComposite.php b/framework/library/FontLib/Glyph/OutlineComposite.php index 0e187feb..8ab0d2c6 100644 --- a/framework/library/FontLib/Glyph/OutlineComposite.php +++ b/framework/library/FontLib/Glyph/OutlineComposite.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $ */ diff --git a/framework/library/FontLib/Glyph/OutlineSimple.php b/framework/library/FontLib/Glyph/OutlineSimple.php index a0367a93..56b2fb49 100644 --- a/framework/library/FontLib/Glyph/OutlineSimple.php +++ b/framework/library/FontLib/Glyph/OutlineSimple.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $ */ @@ -265,7 +265,7 @@ public function getSVGContours($points = null) { $points = $this->points; } - $length = count($points); + $length = (empty($points) ? 0 : count($points)); $firstIndex = 0; $count = 0; @@ -332,4 +332,4 @@ protected function getSVGPath($points, $startIndex, $count) { function midValue($a, $b) { return $a + ($b - $a) / 2; } -} \ No newline at end of file +} diff --git a/framework/library/FontLib/Header.php b/framework/library/FontLib/Header.php index 04bf86d9..cbf137ed 100644 --- a/framework/library/FontLib/Header.php +++ b/framework/library/FontLib/Header.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib; diff --git a/framework/library/FontLib/OpenType/File.php b/framework/library/FontLib/OpenType/File.php index ae858b5a..9c6df96f 100644 --- a/framework/library/FontLib/OpenType/File.php +++ b/framework/library/FontLib/OpenType/File.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\OpenType; diff --git a/framework/library/FontLib/OpenType/TableDirectoryEntry.php b/framework/library/FontLib/OpenType/TableDirectoryEntry.php index baa9df6b..dd75a3e1 100644 --- a/framework/library/FontLib/OpenType/TableDirectoryEntry.php +++ b/framework/library/FontLib/OpenType/TableDirectoryEntry.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\OpenType; diff --git a/framework/library/FontLib/Table/DirectoryEntry.php b/framework/library/FontLib/Table/DirectoryEntry.php index 6c47e2b1..54a67af3 100644 --- a/framework/library/FontLib/Table/DirectoryEntry.php +++ b/framework/library/FontLib/Table/DirectoryEntry.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table; @@ -36,15 +36,20 @@ class DirectoryEntry extends BinaryStream { protected $origF; + /** + * @param string $data + * + * @return int + */ static function computeChecksum($data) { - $len = strlen($data); + $len = mb_strlen($data, '8bit'); $mod = $len % 4; if ($mod) { $data = str_pad($data, $len + (4 - $mod), "\0"); } - $len = strlen($data); + $len = mb_strlen($data, '8bit'); $hi = 0x0000; $lo = 0x0000; diff --git a/framework/library/FontLib/Table/Table.php b/framework/library/FontLib/Table/Table.php index 813f06f9..b1271123 100644 --- a/framework/library/FontLib/Table/Table.php +++ b/framework/library/FontLib/Table/Table.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table; diff --git a/framework/library/FontLib/Table/Type/cmap.php b/framework/library/FontLib/Table/Type/cmap.php index 6df80af3..7db77e1a 100644 --- a/framework/library/FontLib/Table/Type/cmap.php +++ b/framework/library/FontLib/Table/Type/cmap.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; diff --git a/framework/library/FontLib/Table/Type/glyf.php b/framework/library/FontLib/Table/Type/glyf.php index 6a4bfcc5..1fbec3fd 100644 --- a/framework/library/FontLib/Table/Type/glyf.php +++ b/framework/library/FontLib/Table/Type/glyf.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; diff --git a/framework/library/FontLib/Table/Type/head.php b/framework/library/FontLib/Table/Type/head.php index 97b2c0b6..6349f145 100644 --- a/framework/library/FontLib/Table/Type/head.php +++ b/framework/library/FontLib/Table/Type/head.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; diff --git a/framework/library/FontLib/Table/Type/hhea.php b/framework/library/FontLib/Table/Type/hhea.php index 52a95b83..dc60a14b 100644 --- a/framework/library/FontLib/Table/Type/hhea.php +++ b/framework/library/FontLib/Table/Type/hhea.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; diff --git a/framework/library/FontLib/Table/Type/hmtx.php b/framework/library/FontLib/Table/Type/hmtx.php index 3a0751a6..76e3307e 100644 --- a/framework/library/FontLib/Table/Type/hmtx.php +++ b/framework/library/FontLib/Table/Type/hmtx.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; diff --git a/framework/library/FontLib/Table/Type/kern.php b/framework/library/FontLib/Table/Type/kern.php index 49b49cbc..98759464 100644 --- a/framework/library/FontLib/Table/Type/kern.php +++ b/framework/library/FontLib/Table/Type/kern.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; diff --git a/framework/library/FontLib/Table/Type/loca.php b/framework/library/FontLib/Table/Type/loca.php index 3c24f275..cbc2a200 100644 --- a/framework/library/FontLib/Table/Type/loca.php +++ b/framework/library/FontLib/Table/Type/loca.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; diff --git a/framework/library/FontLib/Table/Type/maxp.php b/framework/library/FontLib/Table/Type/maxp.php index e0a8e238..b4ebae03 100644 --- a/framework/library/FontLib/Table/Type/maxp.php +++ b/framework/library/FontLib/Table/Type/maxp.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; diff --git a/framework/library/FontLib/Table/Type/name.php b/framework/library/FontLib/Table/Type/name.php index d211b718..794824d3 100644 --- a/framework/library/FontLib/Table/Type/name.php +++ b/framework/library/FontLib/Table/Type/name.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; diff --git a/framework/library/FontLib/Table/Type/nameRecord.php b/framework/library/FontLib/Table/Type/nameRecord.php index 66915209..2073c20d 100644 --- a/framework/library/FontLib/Table/Type/nameRecord.php +++ b/framework/library/FontLib/Table/Type/nameRecord.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; diff --git a/framework/library/FontLib/Table/Type/os2.php b/framework/library/FontLib/Table/Type/os2.php index 861196da..19a3e21f 100644 --- a/framework/library/FontLib/Table/Type/os2.php +++ b/framework/library/FontLib/Table/Type/os2.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; diff --git a/framework/library/FontLib/Table/Type/post.php b/framework/library/FontLib/Table/Type/post.php index d94e489e..030a942e 100644 --- a/framework/library/FontLib/Table/Type/post.php +++ b/framework/library/FontLib/Table/Type/post.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\Table\Type; @@ -57,7 +57,9 @@ protected function _parse() { $names[$g] = File::$macCharNames[$index]; } else { - $names[$g] = $namesPascal[$index - 258]; + if (array_key_exists($index - 258, $namesPascal)) { + $names[$g] = $namesPascal[$index - 258]; + } } } diff --git a/framework/library/FontLib/TrueType/Collection.php b/framework/library/FontLib/TrueType/Collection.php index dc716404..460ef4da 100644 --- a/framework/library/FontLib/TrueType/Collection.php +++ b/framework/library/FontLib/TrueType/Collection.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\TrueType; diff --git a/framework/library/FontLib/TrueType/File.php b/framework/library/FontLib/TrueType/File.php index 3e086212..3594479a 100644 --- a/framework/library/FontLib/TrueType/File.php +++ b/framework/library/FontLib/TrueType/File.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\TrueType; @@ -124,7 +124,7 @@ function parse() { } function utf8toUnicode($str) { - $len = strlen($str); + $len = mb_strlen($str, '8bit'); $out = array(); for ($i = 0; $i < $len; $i++) { diff --git a/framework/library/FontLib/TrueType/Header.php b/framework/library/FontLib/TrueType/Header.php index 8c592974..7ff79cce 100644 --- a/framework/library/FontLib/TrueType/Header.php +++ b/framework/library/FontLib/TrueType/Header.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\TrueType; diff --git a/framework/library/FontLib/TrueType/TableDirectoryEntry.php b/framework/library/FontLib/TrueType/TableDirectoryEntry.php index 619bd9fe..fc4fe555 100644 --- a/framework/library/FontLib/TrueType/TableDirectoryEntry.php +++ b/framework/library/FontLib/TrueType/TableDirectoryEntry.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\TrueType; diff --git a/framework/library/FontLib/WOFF/File.php b/framework/library/FontLib/WOFF/File.php index 4d1f112a..4668c239 100644 --- a/framework/library/FontLib/WOFF/File.php +++ b/framework/library/FontLib/WOFF/File.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\WOFF; @@ -46,11 +46,11 @@ public function load($file) { $data = $this->read($entry->length); if ($entry->length < $entry->origLength) { - $data = gzuncompress($data); + $data = (string) gzuncompress($data); } // Prepare data ... - $length = strlen($data); + $length = mb_strlen($data, '8bit'); $entry->length = $entry->origLength = $length; $entry->offset = $dataOffset; diff --git a/framework/library/FontLib/WOFF/Header.php b/framework/library/FontLib/WOFF/Header.php index 81e38ea8..65a6f147 100644 --- a/framework/library/FontLib/WOFF/Header.php +++ b/framework/library/FontLib/WOFF/Header.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\WOFF; diff --git a/framework/library/FontLib/WOFF/TableDirectoryEntry.php b/framework/library/FontLib/WOFF/TableDirectoryEntry.php index 40ebef48..eb67c9c4 100644 --- a/framework/library/FontLib/WOFF/TableDirectoryEntry.php +++ b/framework/library/FontLib/WOFF/TableDirectoryEntry.php @@ -3,7 +3,7 @@ * @package php-font-lib * @link https://github.com/PhenX/php-font-lib * @author Fabien Ménager - * @license https://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License */ namespace FontLib\WOFF;