Exemplo n.º 1
0
 private static function decode_style_table()
 {
     $style_table_id = HCImport::$block_index['STAK'][-1]['style_table_id'];
     $table_data = substr(HCImport::$contents, HCImport::$block_index['STBL'][$style_table_id]['offset'], HCImport::$block_index['STBL'][$style_table_id]['size']);
     $fields = unpack('Ncount', substr($table_data, 4, 4));
     $count = $fields['count'];
     $offset = 12;
     for ($s = 0; $s < $count; $s++) {
         $entry = array();
         list($id) = array_values(unpack('Nid', substr($table_data, $offset, 4)));
         list($font_id, $style_bits, $crap2, $size) = array_values(unpack('nfont/Cstyle/C/nsize', substr($table_data, $offset + 12, 6)));
         if ($font_id != 65535) {
             $entry['font_change'] = HCImport::$fonts[$font_id];
         }
         if ($size != 65535) {
             $entry['size_change'] = $size;
         }
         if ($style_bits != 255) {
             $entry['style_change'] = HCImport::decode_style_bits($style_bits);
         }
         HCImport::$styles[$id] = $entry;
         $offset += 24;
     }
 }