🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.1 KiB

  1. #include <limits.h>
  2. #include <stdio.h>
  3. #include <freetype/freetype.h>
  4. #include <ft2build.h>
  5. int
  6. main( void )
  7. {
  8. FT_Library library;
  9. FT_Face face = NULL;
  10. /*
  11. * We assume that `FREETYPE_TESTS_DATA_DIR` was set by `meson test`.
  12. * Otherwise we default to `../tests/data`.
  13. *
  14. * TODO (David): Rewrite this to pass the test directory through the
  15. * command-line.
  16. */
  17. const char* testdata_dir = getenv( "FREETYPE_TESTS_DATA_DIR" );
  18. char filepath[PATH_MAX];
  19. snprintf( filepath, sizeof( filepath ), "%s/%s",
  20. testdata_dir ? testdata_dir : "../tests/data",
  21. "As.I.Lay.Dying.ttf" );
  22. FT_Init_FreeType( &library );
  23. if ( FT_New_Face( library, filepath, 0, &face ) != 0 )
  24. {
  25. fprintf( stderr, "Could not open file: %s\n", filepath );
  26. return 1;
  27. }
  28. for ( FT_ULong i = 59; i < 171; i++ )
  29. {
  30. FT_UInt gid = FT_Get_Char_Index( face, i );
  31. FT_Error code = FT_Load_Glyph( face, gid, FT_LOAD_DEFAULT );
  32. if ( code )
  33. printf( "unknown %d for char %lu, gid %u\n", code, i, gid );
  34. }
  35. return 0;
  36. }
  37. /* EOF */