From 9085a72deb041cf10edfa61d24b7c25f947f736b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 21 Oct 2018 19:08:25 -0700 Subject: [PATCH] [cpal] Touch up palette flags --- src/hb-ot-color.h | 16 ++++++++++------ test/api/test-ot-color.c | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/hb-ot-color.h b/src/hb-ot-color.h index 7d42eb581..ab2cec981 100644 --- a/src/hb-ot-color.h +++ b/src/hb-ot-color.h @@ -70,21 +70,25 @@ hb_ot_color_get_color_layers (hb_face_t *face, /** * hb_ot_color_palette_flags_t: - * @HB_OT_COLOR_PALETTE_FLAG_DEFAULT: default indicating that there is nothing special to note about a color palette. - * @HB_OT_COLOR_PALETTE_FLAG_FOR_LIGHT_BACKGROUND: flag indicating that the color palette is suitable for rendering text on light background. - * @HB_OT_COLOR_PALETTE_FLAG_FOR_DARK_BACKGROUND: flag indicating that the color palette is suitable for rendering text on dark background. + * @HB_OT_COLOR_PALETTE_FLAG_DEFAULT: default indicating that there is nothing special + * to note about a color palette. + * @HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_LIGHT_BACKGROUND: flag indicating that the color + * palette is appropriate to use when displaying the font on a light background such as white. + * @HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND: flag indicating that the color + * palette is appropriate to use when displaying the font on a dark background such as black. * * Since: REPLACEME */ typedef enum { /*< flags >*/ - HB_OT_COLOR_PALETTE_FLAG_DEFAULT = 0x00000000u, - HB_OT_COLOR_PALETTE_FLAG_FOR_LIGHT_BACKGROUND = 0x00000001u, - HB_OT_COLOR_PALETTE_FLAG_FOR_DARK_BACKGROUND = 0x00000002u, + HB_OT_COLOR_PALETTE_FLAG_DEFAULT = 0x00000000u, + HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_LIGHT_BACKGROUND = 0x00000001u, + HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND = 0x00000002u, } hb_ot_color_palette_flags_t; HB_EXTERN hb_ot_color_palette_flags_t hb_ot_color_get_palette_flags (hb_face_t *face, unsigned int palette); + HB_END_DECLS #endif /* HB_OT_COLOR_H */ diff --git a/test/api/test-ot-color.c b/test/api/test-ot-color.c index 0eb0d681e..018b47d1f 100644 --- a/test/api/test-ot-color.c +++ b/test/api/test-ot-color.c @@ -191,8 +191,8 @@ test_hb_ot_color_get_palette_flags_v0 (void) static void test_hb_ot_color_get_palette_flags_v1 (void) { - g_assert_cmpint (hb_ot_color_get_palette_flags (cpal_v1, 0), ==, HB_OT_COLOR_PALETTE_FLAG_FOR_DARK_BACKGROUND); - g_assert_cmpint (hb_ot_color_get_palette_flags (cpal_v1, 1), ==, HB_OT_COLOR_PALETTE_FLAG_FOR_LIGHT_BACKGROUND); + g_assert_cmpint (hb_ot_color_get_palette_flags (cpal_v1, 0), ==, HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_DARK_BACKGROUND); + g_assert_cmpint (hb_ot_color_get_palette_flags (cpal_v1, 1), ==, HB_OT_COLOR_PALETTE_FLAG_USABLE_WITH_LIGHT_BACKGROUND); g_assert_cmpint (hb_ot_color_get_palette_flags (cpal_v0, 2), ==, HB_OT_COLOR_PALETTE_FLAG_DEFAULT); /* numPalettes=3, so palette #3 is out of bounds */