365 }
366
367 /* first, locate the sid in the charset table */
368 sid = font->charset.sids[glyph_index];
369
370 /* now, lookup the name itself */
371 gname = cff_index_get_sid_string( font, sid );
372
373 if ( gname )
374 FT_STRCPYN( buffer, gname, buffer_max );
375
376 error = FT_Err_Ok;
377
378 Exit:
379 return error;
380 }
381
382
383 static FT_UInt
384 cff_get_name_index( CFF_Face face,
385 FT_String* glyph_name )
386 {
387 CFF_Font cff;
388 CFF_Charset charset;
389 FT_Service_PsCMaps psnames;
390 FT_String* name;
391 FT_UShort sid;
392 FT_UInt i;
393
394
395 cff = (CFF_FontRec *)face->extra.data;
396 charset = &cff->charset;
397
398 /* CFF2 table does not have glyph names; */
399 /* we need to use `post' table method */
400 if ( cff->version_major == 2 )
401 {
402 FT_Library library = FT_FACE_LIBRARY( face );
403 FT_Module sfnt_module = FT_Get_Module( library, "sfnt" );
404 FT_Service_GlyphDict service =
405 (FT_Service_GlyphDict)ft_module_get_service(
|
365 }
366
367 /* first, locate the sid in the charset table */
368 sid = font->charset.sids[glyph_index];
369
370 /* now, lookup the name itself */
371 gname = cff_index_get_sid_string( font, sid );
372
373 if ( gname )
374 FT_STRCPYN( buffer, gname, buffer_max );
375
376 error = FT_Err_Ok;
377
378 Exit:
379 return error;
380 }
381
382
383 static FT_UInt
384 cff_get_name_index( CFF_Face face,
385 const FT_String* glyph_name )
386 {
387 CFF_Font cff;
388 CFF_Charset charset;
389 FT_Service_PsCMaps psnames;
390 FT_String* name;
391 FT_UShort sid;
392 FT_UInt i;
393
394
395 cff = (CFF_FontRec *)face->extra.data;
396 charset = &cff->charset;
397
398 /* CFF2 table does not have glyph names; */
399 /* we need to use `post' table method */
400 if ( cff->version_major == 2 )
401 {
402 FT_Library library = FT_FACE_LIBRARY( face );
403 FT_Module sfnt_module = FT_Get_Module( library, "sfnt" );
404 FT_Service_GlyphDict service =
405 (FT_Service_GlyphDict)ft_module_get_service(
|