diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /modules/freetype2/tests/issue-1063/main.c | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules/freetype2/tests/issue-1063/main.c')
-rw-r--r-- | modules/freetype2/tests/issue-1063/main.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/modules/freetype2/tests/issue-1063/main.c b/modules/freetype2/tests/issue-1063/main.c new file mode 100644 index 0000000000..fd5404ebbb --- /dev/null +++ b/modules/freetype2/tests/issue-1063/main.c @@ -0,0 +1,48 @@ +#include <stdio.h> + +#include <freetype/freetype.h> +#include <ft2build.h> + + +int +main( void ) +{ + FT_Library library; + FT_Face face = NULL; + + /* + * We assume that `FREETYPE_TESTS_DATA_DIR` was set by `meson test`. + * Otherwise we default to `../tests/data`. + * + * TODO (David): Rewrite this to pass the test directory through the + * command-line. + */ + const char* testdata_dir = getenv( "FREETYPE_TESTS_DATA_DIR" ); + char filepath[FILENAME_MAX]; + + + snprintf( filepath, sizeof( filepath ), "%s/%s", + testdata_dir ? testdata_dir : "../tests/data", + "As.I.Lay.Dying.ttf" ); + + FT_Init_FreeType( &library ); + if ( FT_New_Face( library, filepath, 0, &face ) != 0 ) + { + 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; +} + +/* EOF */ |