提交 87dd4bff 编写于 作者: B Behdad Esfahbod

[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
上级 88f9dab3
...@@ -40,6 +40,10 @@ HB_BEGIN_DECLS ...@@ -40,6 +40,10 @@ HB_BEGIN_DECLS
#ifndef HB_DISABLE_DEPRECATED #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 */ /* 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_EXTERN HB_DEPRECATED_FOR (hb_ot_layout_table_select_script) hb_bool_t
hb_ot_layout_table_choose_script (hb_face_t *face, hb_ot_layout_table_choose_script (hb_face_t *face,
......
...@@ -462,7 +462,7 @@ struct MathGlyphPartRecord ...@@ -462,7 +462,7 @@ struct MathGlyphPartRecord
out.end_connector_length = font->em_scale (endConnectorLength, scale); out.end_connector_length = font->em_scale (endConnectorLength, scale);
out.full_advance = font->em_scale (fullAdvance, 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, ""); (unsigned int) PartFlags::Extender, "");
out.flags = (hb_ot_math_glyph_part_flags_t) out.flags = (hb_ot_math_glyph_part_flags_t)
......
...@@ -151,7 +151,7 @@ typedef struct hb_ot_math_glyph_variant_t { ...@@ -151,7 +151,7 @@ typedef struct hb_ot_math_glyph_variant_t {
* Since: 1.3.3 * Since: 1.3.3
*/ */
typedef enum { /*< flags >*/ 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; } hb_ot_math_glyph_part_flags_t;
/** /**
......
...@@ -629,19 +629,19 @@ test_get_glyph_assembly (void) ...@@ -629,19 +629,19 @@ test_get_glyph_assembly (void)
g_assert_cmpint(parts[0].start_connector_length, ==, 800); g_assert_cmpint(parts[0].start_connector_length, ==, 800);
g_assert_cmpint(parts[0].end_connector_length, ==, 384); g_assert_cmpint(parts[0].end_connector_length, ==, 384);
g_assert_cmpint(parts[0].full_advance, ==, 2000); 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(hb_font_get_glyph_from_name (hb_font, "horizontal", -1, &glyph));
g_assert_cmpint(parts[1].glyph, ==, glyph); g_assert_cmpint(parts[1].glyph, ==, glyph);
g_assert_cmpint(parts[1].start_connector_length, ==, 524); g_assert_cmpint(parts[1].start_connector_length, ==, 524);
g_assert_cmpint(parts[1].end_connector_length, ==, 800); g_assert_cmpint(parts[1].end_connector_length, ==, 800);
g_assert_cmpint(parts[1].full_advance, ==, 2000); 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(hb_font_get_glyph_from_name (hb_font, "right", -1, &glyph));
g_assert_cmpint(parts[2].glyph, ==, glyph); g_assert_cmpint(parts[2].glyph, ==, glyph);
g_assert_cmpint(parts[2].start_connector_length, ==, 316); g_assert_cmpint(parts[2].start_connector_length, ==, 316);
g_assert_cmpint(parts[2].end_connector_length, ==, 454); g_assert_cmpint(parts[2].end_connector_length, ==, 454);
g_assert_cmpint(parts[2].full_advance, ==, 2000); 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)); g_assert(hb_font_get_glyph_from_name (hb_font, "arrowdown", -1, &glyph));
offset = 0; offset = 0;
...@@ -662,20 +662,20 @@ test_get_glyph_assembly (void) ...@@ -662,20 +662,20 @@ test_get_glyph_assembly (void)
g_assert_cmpint(parts[0].start_connector_length, ==, 365); g_assert_cmpint(parts[0].start_connector_length, ==, 365);
g_assert_cmpint(parts[0].end_connector_length, ==, 158); g_assert_cmpint(parts[0].end_connector_length, ==, 158);
g_assert_cmpint(parts[0].full_advance, ==, 1000); 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(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].glyph, ==, glyph); g_assert_cmpint(parts[1].glyph, ==, glyph);
g_assert_cmpint(parts[1].start_connector_length, ==, 227); g_assert_cmpint(parts[1].start_connector_length, ==, 227);
g_assert_cmpint(parts[1].end_connector_length, ==, 365); g_assert_cmpint(parts[1].end_connector_length, ==, 365);
g_assert_cmpint(parts[1].full_advance, ==, 1000); 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(hb_font_get_glyph_from_name (hb_font, "center", -1, &glyph));
g_assert_cmpint(parts[2].glyph, ==, glyph); g_assert_cmpint(parts[2].glyph, ==, glyph);
g_assert_cmpint(parts[2].start_connector_length, ==, 54); g_assert_cmpint(parts[2].start_connector_length, ==, 54);
g_assert_cmpint(parts[2].end_connector_length, ==, 158); g_assert_cmpint(parts[2].end_connector_length, ==, 158);
g_assert_cmpint(parts[2].full_advance, ==, 1000); 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(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);
g_assert_cmpint(parts[3].glyph, ==, glyph); g_assert_cmpint(parts[3].glyph, ==, glyph);
...@@ -683,13 +683,13 @@ test_get_glyph_assembly (void) ...@@ -683,13 +683,13 @@ test_get_glyph_assembly (void)
g_assert_cmpint(parts[3].start_connector_length, ==, 400); g_assert_cmpint(parts[3].start_connector_length, ==, 400);
g_assert_cmpint(parts[3].end_connector_length, ==, 296); g_assert_cmpint(parts[3].end_connector_length, ==, 296);
g_assert_cmpint(parts[3].full_advance, ==, 1000); 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(hb_font_get_glyph_from_name (hb_font, "top", -1, &glyph));
g_assert_cmpint(parts[4].glyph, ==, glyph); g_assert_cmpint(parts[4].glyph, ==, glyph);
g_assert_cmpint(parts[4].start_connector_length, ==, 123); g_assert_cmpint(parts[4].start_connector_length, ==, 123);
g_assert_cmpint(parts[4].end_connector_length, ==, 192); g_assert_cmpint(parts[4].end_connector_length, ==, 192);
g_assert_cmpint(parts[4].full_advance, ==, 1000); 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(); closeFont();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册