From 87dd4bff1c42f1845fb3d11477e5de210121d48e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 30 May 2019 11:26:17 -0400 Subject: [PATCH] [math] Rename HB_MATH_GLYPH_PART_FLAG_EXTENDER To HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER. Added a deprecated macro. Fixes https://github.com/harfbuzz/harfbuzz/issues/1734 --- src/hb-ot-deprecated.h | 4 ++++ src/hb-ot-math-table.hh | 2 +- src/hb-ot-math.h | 2 +- test/api/test-ot-math.c | 16 ++++++++-------- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/hb-ot-deprecated.h b/src/hb-ot-deprecated.h index bce51b71e..bc72f8a70 100644 --- a/src/hb-ot-deprecated.h +++ b/src/hb-ot-deprecated.h @@ -40,6 +40,10 @@ HB_BEGIN_DECLS #ifndef HB_DISABLE_DEPRECATED +/* https://github.com/harfbuzz/harfbuzz/issues/1734 */ +#define HB_MATH_GLYPH_PART_FLAG_EXTENDER HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER + + /* Like hb_ot_layout_table_find_script, but takes zero-terminated array of scripts to test */ HB_EXTERN HB_DEPRECATED_FOR (hb_ot_layout_table_select_script) hb_bool_t hb_ot_layout_table_choose_script (hb_face_t *face, diff --git a/src/hb-ot-math-table.hh b/src/hb-ot-math-table.hh index dd6226404..0b16e0b9b 100644 --- a/src/hb-ot-math-table.hh +++ b/src/hb-ot-math-table.hh @@ -462,7 +462,7 @@ struct MathGlyphPartRecord out.end_connector_length = font->em_scale (endConnectorLength, scale); out.full_advance = font->em_scale (fullAdvance, scale); - static_assert ((unsigned int) HB_MATH_GLYPH_PART_FLAG_EXTENDER == + static_assert ((unsigned int) HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER == (unsigned int) PartFlags::Extender, ""); out.flags = (hb_ot_math_glyph_part_flags_t) diff --git a/src/hb-ot-math.h b/src/hb-ot-math.h index 805519543..7b2befbce 100644 --- a/src/hb-ot-math.h +++ b/src/hb-ot-math.h @@ -151,7 +151,7 @@ typedef struct hb_ot_math_glyph_variant_t { * Since: 1.3.3 */ typedef enum { /*< flags >*/ - HB_MATH_GLYPH_PART_FLAG_EXTENDER = 0x00000001u /* Extender glyph */ + HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER = 0x00000001u /* Extender glyph */ } hb_ot_math_glyph_part_flags_t; /** diff --git a/test/api/test-ot-math.c b/test/api/test-ot-math.c index 7f500157e..000b0a2c5 100644 --- a/test/api/test-ot-math.c +++ b/test/api/test-ot-math.c @@ -629,19 +629,19 @@ test_get_glyph_assembly (void) g_assert_cmpint(parts[0].start_connector_length, ==, 800); g_assert_cmpint(parts[0].end_connector_length, ==, 384); g_assert_cmpint(parts[0].full_advance, ==, 2000); - g_assert(!(parts[0].flags & HB_MATH_GLYPH_PART_FLAG_EXTENDER)); + g_assert(!(parts[0].flags & HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER)); g_assert(hb_font_get_glyph_from_name (hb_font, "horizontal", -1, &glyph)); g_assert_cmpint(parts[1].glyph, ==, glyph); g_assert_cmpint(parts[1].start_connector_length, ==, 524); g_assert_cmpint(parts[1].end_connector_length, ==, 800); g_assert_cmpint(parts[1].full_advance, ==, 2000); - g_assert(parts[1].flags & HB_MATH_GLYPH_PART_FLAG_EXTENDER); + g_assert(parts[1].flags & HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER); g_assert(hb_font_get_glyph_from_name (hb_font, "right", -1, &glyph)); g_assert_cmpint(parts[2].glyph, ==, glyph); g_assert_cmpint(parts[2].start_connector_length, ==, 316); g_assert_cmpint(parts[2].end_connector_length, ==, 454); g_assert_cmpint(parts[2].full_advance, ==, 2000); - g_assert(!(parts[2].flags & HB_MATH_GLYPH_PART_FLAG_EXTENDER)); + g_assert(!(parts[2].flags & HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER)); g_assert(hb_font_get_glyph_from_name (hb_font, "arrowdown", -1, &glyph)); offset = 0; @@ -662,20 +662,20 @@ test_get_glyph_assembly (void) g_assert_cmpint(parts[0].start_connector_length, ==, 365); g_assert_cmpint(parts[0].end_connector_length, ==, 158); g_assert_cmpint(parts[0].full_advance, ==, 1000); - g_assert(!(parts[0].flags & HB_MATH_GLYPH_PART_FLAG_EXTENDER)); + g_assert(!(parts[0].flags & HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER)); g_assert(hb_font_get_glyph_from_name (hb_font, "vertical", -1, &glyph)); g_assert_cmpint(parts[1].glyph, ==, glyph); g_assert_cmpint(parts[1].glyph, ==, glyph); g_assert_cmpint(parts[1].start_connector_length, ==, 227); g_assert_cmpint(parts[1].end_connector_length, ==, 365); g_assert_cmpint(parts[1].full_advance, ==, 1000); - g_assert(parts[1].flags & HB_MATH_GLYPH_PART_FLAG_EXTENDER); + g_assert(parts[1].flags & HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER); g_assert(hb_font_get_glyph_from_name (hb_font, "center", -1, &glyph)); g_assert_cmpint(parts[2].glyph, ==, glyph); g_assert_cmpint(parts[2].start_connector_length, ==, 54); g_assert_cmpint(parts[2].end_connector_length, ==, 158); g_assert_cmpint(parts[2].full_advance, ==, 1000); - g_assert(!(parts[2].flags & HB_MATH_GLYPH_PART_FLAG_EXTENDER)); + g_assert(!(parts[2].flags & HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER)); g_assert(hb_font_get_glyph_from_name (hb_font, "vertical", -1, &glyph)); g_assert_cmpint(parts[3].glyph, ==, glyph); g_assert_cmpint(parts[3].glyph, ==, glyph); @@ -683,13 +683,13 @@ test_get_glyph_assembly (void) g_assert_cmpint(parts[3].start_connector_length, ==, 400); g_assert_cmpint(parts[3].end_connector_length, ==, 296); g_assert_cmpint(parts[3].full_advance, ==, 1000); - g_assert(parts[1].flags & HB_MATH_GLYPH_PART_FLAG_EXTENDER); + g_assert(parts[1].flags & HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER); g_assert(hb_font_get_glyph_from_name (hb_font, "top", -1, &glyph)); g_assert_cmpint(parts[4].glyph, ==, glyph); g_assert_cmpint(parts[4].start_connector_length, ==, 123); g_assert_cmpint(parts[4].end_connector_length, ==, 192); g_assert_cmpint(parts[4].full_advance, ==, 1000); - g_assert(!(parts[4].flags & HB_MATH_GLYPH_PART_FLAG_EXTENDER)); + g_assert(!(parts[4].flags & HB_OT_MATH_GLYPH_PART_FLAG_EXTENDER)); closeFont();