< prev index next >

src/java.desktop/share/native/libfreetype/src/type1/t1driver.c

Print this page




  54 
  55   /*
  56    * GLYPH DICT SERVICE
  57    *
  58    */
  59 
  60   static FT_Error
  61   t1_get_glyph_name( T1_Face     face,
  62                      FT_UInt     glyph_index,
  63                      FT_Pointer  buffer,
  64                      FT_UInt     buffer_max )
  65   {
  66     FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max );
  67 
  68     return FT_Err_Ok;
  69   }
  70 
  71 
  72   static FT_UInt
  73   t1_get_name_index( T1_Face     face,
  74                      FT_String*  glyph_name )
  75   {
  76     FT_Int  i;
  77 
  78 
  79     for ( i = 0; i < face->type1.num_glyphs; i++ )
  80     {
  81       FT_String*  gname = face->type1.glyph_names[i];
  82 
  83 
  84       if ( !ft_strcmp( glyph_name, gname ) )
  85         return (FT_UInt)i;
  86     }
  87 
  88     return 0;
  89   }
  90 
  91 
  92   static const FT_Service_GlyphDictRec  t1_service_glyph_dict =
  93   {
  94     (FT_GlyphDict_GetNameFunc)  t1_get_glyph_name,    /* get_name   */




  54 
  55   /*
  56    * GLYPH DICT SERVICE
  57    *
  58    */
  59 
  60   static FT_Error
  61   t1_get_glyph_name( T1_Face     face,
  62                      FT_UInt     glyph_index,
  63                      FT_Pointer  buffer,
  64                      FT_UInt     buffer_max )
  65   {
  66     FT_STRCPYN( buffer, face->type1.glyph_names[glyph_index], buffer_max );
  67 
  68     return FT_Err_Ok;
  69   }
  70 
  71 
  72   static FT_UInt
  73   t1_get_name_index( T1_Face           face,
  74                      const FT_String*  glyph_name )
  75   {
  76     FT_Int  i;
  77 
  78 
  79     for ( i = 0; i < face->type1.num_glyphs; i++ )
  80     {
  81       FT_String*  gname = face->type1.glyph_names[i];
  82 
  83 
  84       if ( !ft_strcmp( glyph_name, gname ) )
  85         return (FT_UInt)i;
  86     }
  87 
  88     return 0;
  89   }
  90 
  91 
  92   static const FT_Service_GlyphDictRec  t1_service_glyph_dict =
  93   {
  94     (FT_GlyphDict_GetNameFunc)  t1_get_glyph_name,    /* get_name   */


< prev index next >