Exemple #1
0
  cff_get_advances( FT_Face    face,
                    FT_UInt    start,
                    FT_UInt    count,
                    FT_Int32   flags,
                    FT_Fixed*  advances )
  {
    FT_UInt       nn;
    FT_Error      error = CFF_Err_Ok;
    FT_GlyphSlot  slot  = face->glyph;


    flags |= (FT_UInt32)FT_LOAD_ADVANCE_ONLY;

    for ( nn = 0; nn < count; nn++ )
    {
      error = Load_Glyph( slot, face->size, start + nn, flags );
      if ( error )
        break;

      advances[nn] = ( flags & FT_LOAD_VERTICAL_LAYOUT )
                     ? slot->linearVertAdvance
                     : slot->linearHoriAdvance;
    }

    return error;
  }
Exemple #2
0
static TT_Error Find_Glyph(TTF_Font *font, Uint16 ch)
{
	int retval;

	retval = 0;
	if ( ch < 256 ) {
		font->current = &font->cache[ch];
	} else {
		if ( font->scratch.cached != ch ) {
			Flush_Glyph(&font->scratch);
		}
		font->current = &font->scratch;
	}
	if ( ! font->current->cached ) {
		retval = Load_Glyph(font, ch, font->current);
	}
	return retval;
}
  cff_get_advances( FT_Face    ftface,
                    FT_UInt    start,
                    FT_UInt    count,
                    FT_UInt    flags,
                    FT_Fixed*  advances )
  {
    CFF_Face      face = (CFF_Face) ftface;
    FT_UInt       nn;
    FT_Error      error = 0;
    FT_GlyphSlot  slot = face->root.glyph;

    flags |= FT_LOAD_ADVANCE_ONLY;

    for (nn = 0; nn < count; nn++)
    {
      error = Load_Glyph( slot, face->root.size, start+nn, flags );
      if (error) break;

      advances[nn] = (flags & FT_LOAD_VERTICAL_LAYOUT)
                   ? slot->advance.y
                   : slot->advance.x;
    }
    return error;
  }