Make HB_BORING_EXPANSION opt-in instead of opt-out

Fixes https://github.com/harfbuzz/harfbuzz/issues/3757
This commit is contained in:
Behdad Esfahbod 2022-08-12 12:17:37 -06:00
parent f4f7d691af
commit 4ab7e579cb
4 changed files with 8 additions and 5 deletions

View File

@ -35,6 +35,9 @@
#include "config.h"
#endif
#ifndef HB_BORING_EXPANSION
#define HB_NO_BORING_EXPANSION
#endif
#ifdef HB_TINY
#define HB_LEAN

View File

@ -27,9 +27,7 @@
#ifndef HB_TEST_H
#define HB_TEST_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <hb-config.hh>
#include <hb-glib.h>

View File

@ -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);

View File

@ -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);