[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
This commit is contained in:
Behdad Esfahbod 2019-05-30 11:26:17 -04:00
parent 88f9dab366
commit 87dd4bff1c
4 changed files with 14 additions and 10 deletions

View File

@ -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,

View File

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

View File

@ -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;
/**

View File

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