#include #include #include FT_FREETYPE_H static FT_Library context; int main(int argc, char **argv) { FT_Face face; int ch1, ch2; FT_Vector kvec; FT_Init_FreeType(&context); if ( FT_New_Face( context, "AMBROSIA.PFB", 0, &face) ) { fprintf( stderr, "Error loading font\n"); return( 1 ); } if ( FT_Attach_File( face, "AMBROSIA.PFM") ) { fprintf( stderr, "Error loading metrics\n"); return( 1 ); } ch1 = FT_Get_Char_Index(face,'T'); ch2 = FT_Get_Char_Index(face,'o'); if ( FT_Get_Kerning( face, ch1, ch2,FT_KERNING_UNSCALED,&kvec)) { fprintf( stderr, "Error kerning\n"); return( 1 ); } printf( "x=%d y=%d\n", kvec.x, kvec.y ); return( 0 ); }