Home | History | Annotate | Download | only in cff

Lines Matching refs:idx

202   cff_index_read_offset( CFF_Index  idx,
206 FT_Stream stream = idx->stream;
211 if ( !FT_STREAM_READ( tmp, idx->off_size ) )
216 for ( nn = 0; nn < idx->off_size; nn++ )
226 cff_index_init( CFF_Index idx,
235 FT_MEM_ZERO( idx, sizeof ( *idx ) );
237 idx->stream = stream;
238 idx->start = FT_STREAM_POS();
257 idx->count = count;
258 idx->off_size = offsize;
261 idx->data_offset = idx->start + 3 + size;
266 size = cff_index_read_offset( idx, &error );
276 idx->data_size = --size;
281 if ( FT_FRAME_EXTRACT( size, idx->bytes ) )
294 FT_FREE( idx->offsets );
301 cff_index_done( CFF_Index idx )
303 if ( idx->stream )
305 FT_Stream stream = idx->stream;
309 if ( idx->bytes )
310 FT_FRAME_RELEASE( idx->bytes );
312 FT_FREE( idx->offsets );
313 FT_MEM_ZERO( idx, sizeof ( *idx ) );
319 cff_index_load_offsets( CFF_Index idx )
322 FT_Stream stream = idx->stream;
326 if ( idx->count > 0 && idx->offsets == NULL )
328 FT_Byte offsize = idx->off_size;
335 data_size = (FT_ULong)( idx->count + 1 ) * offsize;
337 if ( FT_NEW_ARRAY( idx->offsets, idx->count + 1 ) ||
338 FT_STREAM_SEEK( idx->start + 3 ) ||
342 poff = idx->offsets;
373 FT_FREE( idx->offsets );
383 cff_index_get_pointers( CFF_Index idx,
388 FT_Memory memory = idx->stream->memory;
395 if ( idx->offsets == NULL )
397 error = cff_index_load_offsets( idx );
402 if ( idx->count > 0 &&
403 !FT_NEW_ARRAY( t, idx->count + 1 ) &&
405 idx->data_size + idx->count ) ) )
409 FT_Byte* org_bytes = idx->bytes;
412 /* at this point, `idx->offsets' can't be NULL */
413 cur_offset = idx->offsets[0] - 1;
416 if ( cur_offset >= idx->data_size )
429 for ( n = 1; n <= idx->count; n++ )
431 FT_ULong next_offset = idx->offsets[n] - 1;
437 ( next_offset >= idx->data_size && n < idx->count ) )
469 cff_index_access_element( CFF_Index idx,
477 if ( idx && idx->count > element )
480 FT_Stream stream = idx->stream;
485 if ( !idx->offsets )
487 FT_ULong pos = element * idx->off_size;
490 if ( FT_STREAM_SEEK( idx->start + 3 + pos ) )
493 off1 = cff_index_read_offset( idx, &error );
502 off2 = cff_index_read_offset( idx, &error );
504 while ( off2 == 0 && element < idx->count );
509 off1 = idx->offsets[element];
515 off2 = idx->offsets[element];
517 } while ( off2 == 0 && element < idx->count );
524 idx->data_offset > stream->size - off2 + 1 )
529 off2, stream->size - idx->data_offset + 1 ));
530 off2 = stream->size - idx->data_offset + 1;
538 if ( idx->bytes )
541 *pbytes = idx->bytes + off1 - 1;
546 if ( FT_STREAM_SEEK( idx->data_offset + off1 - 1 ) ||
567 cff_index_forget_element( CFF_Index idx,
570 if ( idx->bytes == 0 )
572 FT_Stream stream = idx->stream;
585 CFF_Index idx = &font->name_index;
586 FT_Memory memory = idx->stream->memory;
593 error = cff_index_access_element( idx, element, &bytes, &byte_len );
602 cff_index_forget_element( idx, &bytes );
1297 CFF_Index idx,
1337 error = cff_index_access_element( idx, font_index, &dict, &dict_len );
1344 cff_index_forget_element( idx, &dict );
1522 FT_UInt idx;
1546 for ( idx = 0; idx < fd_index.count; idx++ )
1547 font->subfonts[idx] = sub + idx;
1550 for ( idx = 0; idx < fd_index.count; idx++ )
1552 sub = font->subfonts[idx];
1553 FT_TRACE4(( "parsing subfont %u\n", idx ));
1554 error = cff_subfont_load( sub, &fd_index, idx,
1631 FT_UInt idx;
1643 for ( idx = 0; idx < font->num_subfonts; idx++ )
1644 cff_subfont_done( memory, font->subfonts[idx] );