Beispiel #1
0
  FT_Get_Advance( FT_Face    face,
                  FT_UInt    gindex,
                  FT_Int32   flags,
                  FT_Fixed  *padvance )
  {
    FT_Face_GetAdvancesFunc  func;


    if ( !face )
      return FT_THROW( Invalid_Face_Handle );

    if ( !padvance )
      return FT_THROW( Invalid_Argument );

    if ( gindex >= (FT_UInt)face->num_glyphs )
      return FT_THROW( Invalid_Glyph_Index );

    func = face->driver->clazz->get_advances;
    if ( func && LOAD_ADVANCE_FAST_CHECK( flags ) )
    {
      FT_Error  error;


      error = func( face, gindex, 1, flags, padvance );
      if ( !error )
        return _ft_face_scale_advances( face, padvance, 1, flags );

      if ( FT_ERR_NEQ( error, Unimplemented_Feature ) )
        return error;
    }

    return FT_Get_Advances( face, gindex, 1, flags, padvance );
  }
Beispiel #2
0
int
test_load_advances( btimer_t*  timer,
                    FT_Face    face,
                    void*      user_data )
{
  int        done = 0;
  FT_Fixed*  advances;
  FT_ULong   flags = *((FT_ULong*)user_data);


  advances = (FT_Fixed *)calloc( sizeof ( FT_Fixed ), face->num_glyphs );

  TIMER_START( timer );

  FT_Get_Advances( face, 0, face->num_glyphs, flags, advances );
  done += face->num_glyphs;

  TIMER_STOP( timer );

  free( advances );

  return done;
}