Lines Matching refs:font

583   cff_index_get_name( CFF_Font  font,
586 CFF_Index idx = &font->name_index;
612 cff_index_get_string( CFF_Font font,
615 return ( element < font->num_strings )
616 ? (FT_String*)font->strings[element]
622 cff_index_get_sid_string( CFF_Font font,
631 return cff_index_get_string( font, sid - 391 );
634 if ( !font->psnames )
638 return (FT_String *)font->psnames->adobe_std_strings( sid );
774 /*** CFF font support ***/
957 /* true: The charset constructed for the glyphs in the font's */
1082 /* Note: The encoding table in a CFF font is indexed by glyph index; */
1112 /* coded in the font. Hence, the number of codes found */
1183 /* simple check; one never knows what can be found in a font */
1233 /* We take into account the fact a CFF font can use a predefined */
1297 cff_subfont_load( CFF_SubFont font,
1308 CFF_FontRecDict top = &font->font_dict;
1309 CFF_Private priv = &font->private_dict;
1312 cff_parser_init( &parser, CFF_CODE_TOPDICT, &font->font_dict, library );
1350 /* if it is a CID font, we stop there */
1368 if ( FT_STREAM_SEEK( base_offset + font->font_dict.private_offset ) ||
1369 FT_FRAME_ENTER( font->font_dict.private_size ) )
1391 error = cff_index_init( &font->local_subrs_index, stream, 1 );
1395 error = cff_index_get_pointers( &font->local_subrs_index,
1396 &font->local_subrs, NULL );
1422 CFF_Font font,
1446 FT_ZERO( font );
1449 font->stream = stream;
1450 font->memory = memory;
1451 dict = &font->top_font.font_dict;
1454 /* read CFF font header */
1455 if ( FT_STREAM_READ_FIELDS( cff_header_fields, font ) )
1459 if ( font->version_major != 1 ||
1460 font->header_size < 4 ||
1461 font->absolute_offsize > 4 )
1463 FT_TRACE2(( " not a CFF font header\n" ));
1469 if ( FT_STREAM_SKIP( font->header_size - 4 ) )
1473 if ( FT_SET_ERROR( cff_index_init( &font->name_index,
1475 FT_SET_ERROR( cff_index_init( &font->font_dict_index,
1479 FT_SET_ERROR( cff_index_init( &font->global_subrs_index,
1482 &font->strings,
1483 &font->string_pool ) ) )
1486 font->num_strings = string_index.count;
1493 if ( subfont_index >= (FT_Int)font->name_index.count )
1496 " invalid subfont index for pure CFF font (%d)\n",
1502 font->num_faces = font->name_index.count;
1508 if ( font->name_index.count > 1 )
1511 " invalid CFF font with multiple subfonts\n"
1519 /* in case of a font format check, simply exit now */
1523 /* now, parse the top-level font dictionary */
1525 error = cff_subfont_load( &font->top_font,
1526 &font->font_dict_index,
1537 error = cff_index_init( &font->charstrings_index, stream, 0 );
1541 /* now, check for a CID font */
1549 /* this is a CID-keyed font, we must now allocate a table of */
1560 FT_TRACE0(( "cff_font_load: FD array too large in CID font\n" ));
1564 /* allocate & read each font dict independently */
1565 font->num_subfonts = fd_index.count;
1571 font->subfonts[idx] = sub + idx;
1576 sub = font->subfonts[idx];
1585 error = CFF_Load_FD_Select( &font->fd_select,
1586 font->charstrings_index.count,
1597 font->num_subfonts = 0;
1607 font->num_glyphs = font->charstrings_index.count;
1609 error = cff_index_get_pointers( &font->global_subrs_index,
1610 &font->global_subrs, NULL );
1616 if ( font->num_glyphs > 0 )
1621 error = cff_charset_load( &font->charset, font->num_glyphs, stream,
1629 error = cff_encoding_load( &font->encoding,
1630 &font->charset,
1631 font->num_glyphs,
1640 /* get the font name (/CIDFontName for CID-keyed fonts, */
1642 font->font_name = cff_index_get_name( font, subfont_index );
1652 cff_font_done( CFF_Font font )
1654 FT_Memory memory = font->memory;
1658 cff_index_done( &font->global_subrs_index );
1659 cff_index_done( &font->font_dict_index );
1660 cff_index_done( &font->name_index );
1661 cff_index_done( &font->charstrings_index );
1663 /* release font dictionaries, but only if working with */
1664 /* a CID keyed CFF font */
1665 if ( font->num_subfonts > 0 )
1667 for ( idx = 0; idx < font->num_subfonts; idx++ )
1668 cff_subfont_done( memory, font->subfonts[idx] );
1671 FT_FREE( font->subfonts[0] );
1674 cff_encoding_done( &font->encoding );
1675 cff_charset_done( &font->charset, font->stream );
1677 cff_subfont_done( memory, &font->top_font );
1679 CFF_Done_FD_Select( &font->fd_select, font->stream );
1681 FT_FREE( font->font_info );
1683 FT_FREE( font->font_name );
1684 FT_FREE( font->global_subrs );
1685 FT_FREE( font->strings );
1686 FT_FREE( font->string_pool );
1688 if ( font->cf2_instance.finalizer )
1690 font->cf2_instance.finalizer( font->cf2_instance.data );
1691 FT_FREE( font->cf2_instance.data );