From 4ab7e579cb8f4fd4f5ee2e1c0404e58edf8eb8e6 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 12 Aug 2022 12:17:37 -0600 Subject: [PATCH] Make HB_BORING_EXPANSION opt-in instead of opt-out Fixes https://github.com/harfbuzz/harfbuzz/issues/3757 --- src/hb-config.hh | 3 +++ test/api/hb-test.h | 4 +--- test/api/test-be-glyph-advance.c | 2 +- test/api/test-be-num-glyphs.c | 4 +++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/hb-config.hh b/src/hb-config.hh index db8ec0e90..5567ddaec 100644 --- a/src/hb-config.hh +++ b/src/hb-config.hh @@ -35,6 +35,9 @@ #include "config.h" #endif +#ifndef HB_BORING_EXPANSION +#define HB_NO_BORING_EXPANSION +#endif #ifdef HB_TINY #define HB_LEAN diff --git a/test/api/hb-test.h b/test/api/hb-test.h index 840637aac..2be47beb7 100644 --- a/test/api/hb-test.h +++ b/test/api/hb-test.h @@ -27,9 +27,7 @@ #ifndef HB_TEST_H #define HB_TEST_H -#ifdef HAVE_CONFIG_H -#include -#endif +#include #include diff --git a/test/api/test-be-glyph-advance.c b/test/api/test-be-glyph-advance.c index 77fdee136..300746dcb 100644 --- a/test/api/test-be-glyph-advance.c +++ b/test/api/test-be-glyph-advance.c @@ -77,7 +77,7 @@ test_maxp_and_hmtx (void) g_assert_cmpuint (hb_font_get_glyph_h_advance (font, 2), ==, 3); g_assert_cmpuint (hb_font_get_glyph_h_advance (font, 3), ==, 3); g_assert_cmpuint (hb_font_get_glyph_h_advance (font, 4), ==, 3); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K g_assert_cmpuint (hb_font_get_glyph_h_advance (font, 5), ==, 8); g_assert_cmpuint (hb_font_get_glyph_h_advance (font, 6), ==, 9); g_assert_cmpuint (hb_font_get_glyph_h_advance (font, 7), ==, 9); diff --git a/test/api/test-be-num-glyphs.c b/test/api/test-be-num-glyphs.c index ab8d11043..866343fe5 100644 --- a/test/api/test-be-num-glyphs.c +++ b/test/api/test-be-num-glyphs.c @@ -34,7 +34,9 @@ test_maxp_and_loca (void) const char maxp_data[] = "\x00\x00\x50\x00" // version "\x00\x05" // numGlyphs ; +#ifndef HB_NO_BEYOND_64K const char loca_data[18] = ""; +#endif face = hb_face_builder_create (); g_assert_cmpuint (hb_face_get_glyph_count (face), ==, 0); @@ -45,7 +47,7 @@ test_maxp_and_loca (void) g_assert_cmpuint (hb_face_get_glyph_count (face), ==, 5); hb_face_destroy (face); -#ifndef HB_NO_BORING_EXPANSION +#ifndef HB_NO_BEYOND_64K face = hb_face_builder_create (); HB_FACE_ADD_TABLE (face, "maxp", maxp_data); HB_FACE_ADD_TABLE (face, "loca", loca_data);