2021-06-15 23:12:57 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include <freetype/freetype.h>
|
|
|
|
#include <ft2build.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main( void )
|
|
|
|
{
|
|
|
|
FT_Library library;
|
2021-07-15 19:02:57 +02:00
|
|
|
FT_Face face = NULL;
|
2021-06-15 23:12:57 +02:00
|
|
|
|
|
|
|
/* Assumes this is run from out/ build directory though 'meson test -C out' */
|
|
|
|
const char* filepath = "../tests/data/As.I.Lay.Dying.ttf";
|
|
|
|
|
|
|
|
FT_Init_FreeType( &library );
|
2021-07-15 19:02:57 +02:00
|
|
|
if ( FT_New_Face( library, filepath, 0, &face ) != 0 )
|
2021-06-15 23:12:57 +02:00
|
|
|
{
|
|
|
|
fprintf( stderr, "Could not open file: %s\n", filepath );
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( FT_ULong i = 59; i < 171; i++ )
|
|
|
|
{
|
|
|
|
FT_UInt gid = FT_Get_Char_Index( face, i );
|
|
|
|
FT_Error code = FT_Load_Glyph( face, gid, FT_LOAD_DEFAULT );
|
|
|
|
if ( code )
|
|
|
|
printf( "unknown %d for char %lu, gid %u\n", code, i, gid );
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|