Home | History | Annotate | Download | only in cff

Lines Matching refs:idx

203   cff_index_read_offset( CFF_Index  idx,
207 FT_Stream stream = idx->stream;
212 if ( !FT_STREAM_READ( tmp, idx->off_size ) )
217 for ( nn = 0; nn < idx->off_size; nn++ )
227 cff_index_init( CFF_Index idx,
236 FT_MEM_ZERO( idx, sizeof ( *idx ) );
238 idx->stream = stream;
239 idx->start = FT_STREAM_POS();
258 idx->count = count;
259 idx->off_size = offsize;
262 idx->data_offset = idx->start + 3 + size;
267 size = cff_index_read_offset( idx, &error );
277 idx->data_size = --size;
282 if ( FT_FRAME_EXTRACT( size, idx->bytes ) )
295 FT_FREE( idx->offsets );
302 cff_index_done( CFF_Index idx )
304 if ( idx->stream )
306 FT_Stream stream = idx->stream;
310 if ( idx->bytes )
311 FT_FRAME_RELEASE( idx->bytes );
313 FT_FREE( idx->offsets );
314 FT_MEM_ZERO( idx, sizeof ( *idx ) );
320 cff_index_load_offsets( CFF_Index idx )
323 FT_Stream stream = idx->stream;
327 if ( idx->count > 0 && idx->offsets == NULL )
329 FT_Byte offsize = idx->off_size;
336 data_size = (FT_ULong)( idx->count + 1 ) * offsize;
338 if ( FT_NEW_ARRAY( idx->offsets, idx->count + 1 ) ||
339 FT_STREAM_SEEK( idx->start + 3 ) ||
343 poff = idx->offsets;
374 FT_FREE( idx->offsets );
384 cff_index_get_pointers( CFF_Index idx,
389 FT_Memory memory = idx->stream->memory;
396 if ( idx->offsets == NULL )
398 error = cff_index_load_offsets( idx );
403 if ( idx->count > 0 &&
404 !FT_NEW_ARRAY( t, idx->count + 1 ) &&
406 idx->data_size + idx->count ) ) )
410 FT_Byte* org_bytes = idx->bytes;
413 /* at this point, `idx->offsets' can't be NULL */
414 cur_offset = idx->offsets[0] - 1;
417 if ( cur_offset >= idx->data_size )
430 for ( n = 1; n <= idx->count; n++ )
432 FT_ULong next_offset = idx->offsets[n] - 1;
438 ( next_offset >= idx->data_size && n < idx->count ) )
470 cff_index_access_element( CFF_Index idx,
478 if ( idx && idx->count > element )
481 FT_Stream stream = idx->stream;
486 if ( !idx->offsets )
488 FT_ULong pos = element * idx->off_size;
491 if ( FT_STREAM_SEEK( idx->start + 3 + pos ) )
494 off1 = cff_index_read_offset( idx, &error );
503 off2 = cff_index_read_offset( idx, &error );
505 while ( off2 == 0 && element < idx->count );
510 off1 = idx->offsets[element];
516 off2 = idx->offsets[element];
518 } while ( off2 == 0 && element < idx->count );
527 if ( idx->bytes )
530 *pbytes = idx->bytes + off1 - 1;
535 if ( FT_STREAM_SEEK( idx->data_offset + off1 - 1 ) ||
556 cff_index_forget_element( CFF_Index idx,
559 if ( idx->bytes == 0 )
561 FT_Stream stream = idx->stream;
574 CFF_Index idx = &font->name_index;
575 FT_Memory memory = idx->stream->memory;
582 error = cff_index_access_element( idx, element, &bytes, &byte_len );
591 cff_index_forget_element( idx, &bytes );
1308 CFF_Index idx,
1348 error = cff_index_access_element( idx, font_index, &dict, &dict_len );
1352 cff_index_forget_element( idx, &dict );
1528 FT_UInt idx;
1552 for ( idx = 0; idx < fd_index.count; idx++ )
1553 font->subfonts[idx] = sub + idx;
1556 for ( idx = 0; idx < fd_index.count; idx++ )
1558 sub = font->subfonts[idx];
1559 error = cff_subfont_load( sub, &fd_index, idx,
1636 FT_UInt idx;
1648 for ( idx = 0; idx < font->num_subfonts; idx++ )
1649 cff_subfont_done( memory, font->subfonts[idx] );