powered by nequal
Home » IO_SWF » Timeline » 2860

Changeset 2860 -- 2012-02-02 17:37:01

Author
よや
Comment
care for NumGlyphs === 0.

Diffs

IO_SWF/trunk/IO/SWF/Tag/Font.php

@@ -43,6 +43,9 @@
$fontNameLen = $reader->getUI8();
$this->FontName = $reader->getData($fontNameLen);
$numGlyphs = $reader->getUI16LE();
+        if ($numGlyphs === 0) {
+            return ; // no glyphs field.
+        }
list($startOfOffsetTable, $dummy) = $reader->getOffset();
if ($this->FontFlagsWideOffsets) {
for ($i = 0 ; $i < $numGlyphs ; $i++) {
@@ -167,6 +170,9 @@
$writer->putData($this->FontName);
$numGlyphs = count($this->OffsetTable);
$writer->putUI16LE($numGlyphs);
+        if ($numGlyphs === 0) {
+            return $writer->output(); // no glyphs field.
+        }
list($startOfOffsetTable, $dummy) = $writer->getOffset();
$startOfOffsetTable2 = array();
if ($this->FontFlagsWideOffsets) {