6f273f6878
* tests/README.md: documentation explaining how to build and run the tests with the Meson build. * tests/scripts/download-test-fonts.sh: Simple script to download test font files to the 'tests/data/' folder. * meson.build, meson_options.txt, tests/meson.build: Add 'tests' option to enable building and running the test programs, disabled by default. * tests/issue-1063/main.c: Simple regression test to exhibit issue 1063. * .gitignore: Ignore the content of the tests/data/ folder for now.
33 lines
717 B
C
33 lines
717 B
C
#include <stdio.h>
|
|
|
|
#include <freetype/freetype.h>
|
|
#include <ft2build.h>
|
|
|
|
int
|
|
main( void )
|
|
{
|
|
FT_Library library;
|
|
FT_Face face;
|
|
|
|
/* 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 );
|
|
FT_New_Face( library, filepath, 0, &face );
|
|
if ( !face )
|
|
{
|
|
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;
|
|
}
|