[name] Rename hb_name_id_t to hb_ot_name_id_t

https://github.com/harfbuzz/harfbuzz/pull/1254
This commit is contained in:
Behdad Esfahbod 2018-10-30 14:04:09 -07:00
parent 881e1054bc
commit a7aba99baa
11 changed files with 138 additions and 137 deletions

View File

@ -481,7 +481,8 @@ hb_ot_font_set_funcs
<SECTION> <SECTION>
<FILE>hb-ot-name</FILE> <FILE>hb-ot-name</FILE>
hb_name_id_t hb_ot_name_id_t
HB_OT_NAME_ID_INVALID
hb_ot_name_entry_t hb_ot_name_entry_t
hb_ot_name_list_names hb_ot_name_list_names
hb_ot_name_get_utf16 hb_ot_name_get_utf16

View File

@ -58,21 +58,21 @@ struct CPALV1Tail
hb_array (base+paletteFlagsZ, palette_count)[palette_index]; hb_array (base+paletteFlagsZ, palette_count)[palette_index];
} }
inline hb_name_id_t inline hb_ot_name_id_t
get_palette_name_id (const void *base, get_palette_name_id (const void *base,
unsigned int palette_index, unsigned int palette_index,
unsigned int palette_count) const unsigned int palette_count) const
{ {
if (!paletteLabelsZ) return HB_NAME_ID_INVALID; if (!paletteLabelsZ) return HB_OT_NAME_ID_INVALID;
return hb_array (base+paletteLabelsZ, palette_count)[palette_index]; return hb_array (base+paletteLabelsZ, palette_count)[palette_index];
} }
inline hb_name_id_t inline hb_ot_name_id_t
get_color_name_id (const void *base, get_color_name_id (const void *base,
unsigned int color_index, unsigned int color_index,
unsigned int color_count) const unsigned int color_count) const
{ {
if (!colorLabelsZ) return HB_NAME_ID_INVALID; if (!colorLabelsZ) return HB_OT_NAME_ID_INVALID;
return hb_array (base+colorLabelsZ, color_count)[color_index]; return hb_array (base+colorLabelsZ, color_count)[color_index];
} }
@ -123,10 +123,10 @@ struct CPAL
inline hb_ot_color_palette_flags_t get_palette_flags (unsigned int palette_index) const inline hb_ot_color_palette_flags_t get_palette_flags (unsigned int palette_index) const
{ return v1 ().get_palette_flags (this, palette_index, numPalettes); } { return v1 ().get_palette_flags (this, palette_index, numPalettes); }
inline hb_name_id_t get_palette_name_id (unsigned int palette_index) const inline hb_ot_name_id_t get_palette_name_id (unsigned int palette_index) const
{ return v1 ().get_palette_name_id (this, palette_index, numPalettes); } { return v1 ().get_palette_name_id (this, palette_index, numPalettes); }
inline hb_name_id_t get_color_name_id (unsigned int color_index) const inline hb_ot_name_id_t get_color_name_id (unsigned int color_index) const
{ return v1 ().get_color_name_id (this, color_index, numColors); } { return v1 ().get_color_name_id (this, color_index, numColors); }
inline unsigned int get_palette_colors (unsigned int palette_index, inline unsigned int get_palette_colors (unsigned int palette_index,

View File

@ -129,11 +129,11 @@ hb_ot_color_palette_get_count (hb_face_t *face)
* have themed palettes like "Spring", "Summer", "Fall", and "Winter". * have themed palettes like "Spring", "Summer", "Fall", and "Winter".
* *
* Returns: an identifier within @face's `name` table. * Returns: an identifier within @face's `name` table.
* If the requested palette has no name the result is #HB_NAME_ID_INVALID. * If the requested palette has no name the result is #HB_OT_NAME_ID_INVALID.
* *
* Since: 2.1.0 * Since: 2.1.0
*/ */
hb_name_id_t hb_ot_name_id_t
hb_ot_color_palette_get_name_id (hb_face_t *face, hb_ot_color_palette_get_name_id (hb_face_t *face,
unsigned int palette_index) unsigned int palette_index)
{ {
@ -149,7 +149,7 @@ hb_ot_color_palette_get_name_id (hb_face_t *face,
* *
* Since: 2.1.0 * Since: 2.1.0
*/ */
hb_name_id_t hb_ot_name_id_t
hb_ot_color_palette_color_get_name_id (hb_face_t *face, hb_ot_color_palette_color_get_name_id (hb_face_t *face,
unsigned int color_index) unsigned int color_index)
{ {

View File

@ -49,11 +49,11 @@ hb_ot_color_has_palettes (hb_face_t *face);
HB_EXTERN unsigned int HB_EXTERN unsigned int
hb_ot_color_palette_get_count (hb_face_t *face); hb_ot_color_palette_get_count (hb_face_t *face);
HB_EXTERN hb_name_id_t HB_EXTERN hb_ot_name_id_t
hb_ot_color_palette_get_name_id (hb_face_t *face, hb_ot_color_palette_get_name_id (hb_face_t *face,
unsigned int palette_index); unsigned int palette_index);
HB_EXTERN hb_name_id_t HB_EXTERN hb_ot_name_id_t
hb_ot_color_palette_color_get_name_id (hb_face_t *face, hb_ot_color_palette_color_get_name_id (hb_face_t *face,
unsigned int color_index); unsigned int color_index);

View File

@ -1053,12 +1053,12 @@ hb_ot_layout_position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer)
* Since: 0.9.10 * Since: 0.9.10
**/ **/
hb_bool_t hb_bool_t
hb_ot_layout_get_size_params (hb_face_t *face, hb_ot_layout_get_size_params (hb_face_t *face,
unsigned int *design_size, /* OUT. May be NULL */ unsigned int *design_size, /* OUT. May be NULL */
unsigned int *subfamily_id, /* OUT. May be NULL */ unsigned int *subfamily_id, /* OUT. May be NULL */
hb_name_id_t *subfamily_name_id, /* OUT. May be NULL */ hb_ot_name_id_t *subfamily_name_id, /* OUT. May be NULL */
unsigned int *range_start, /* OUT. May be NULL */ unsigned int *range_start, /* OUT. May be NULL */
unsigned int *range_end /* OUT. May be NULL */) unsigned int *range_end /* OUT. May be NULL */)
{ {
const OT::GPOS &gpos = _get_gpos (face); const OT::GPOS &gpos = _get_gpos (face);
const hb_tag_t tag = HB_TAG ('s','i','z','e'); const hb_tag_t tag = HB_TAG ('s','i','z','e');
@ -1086,7 +1086,7 @@ hb_ot_layout_get_size_params (hb_face_t *face,
if (design_size) *design_size = 0; if (design_size) *design_size = 0;
if (subfamily_id) *subfamily_id = 0; if (subfamily_id) *subfamily_id = 0;
if (subfamily_name_id) *subfamily_name_id = HB_NAME_ID_INVALID; if (subfamily_name_id) *subfamily_name_id = HB_OT_NAME_ID_INVALID;
if (range_start) *range_start = 0; if (range_start) *range_start = 0;
if (range_end) *range_end = 0; if (range_end) *range_end = 0;
@ -1118,14 +1118,14 @@ hb_ot_layout_get_size_params (hb_face_t *face,
* Since: 2.0.0 * Since: 2.0.0
**/ **/
hb_bool_t hb_bool_t
hb_ot_layout_feature_get_name_ids (hb_face_t *face, hb_ot_layout_feature_get_name_ids (hb_face_t *face,
hb_tag_t table_tag, hb_tag_t table_tag,
unsigned int feature_index, unsigned int feature_index,
hb_name_id_t *label_id, /* OUT. May be NULL */ hb_ot_name_id_t *label_id, /* OUT. May be NULL */
hb_name_id_t *tooltip_id, /* OUT. May be NULL */ hb_ot_name_id_t *tooltip_id, /* OUT. May be NULL */
hb_name_id_t *sample_id, /* OUT. May be NULL */ hb_ot_name_id_t *sample_id, /* OUT. May be NULL */
unsigned int *num_named_parameters, /* OUT. May be NULL */ unsigned int *num_named_parameters, /* OUT. May be NULL */
hb_name_id_t *first_param_id /* OUT. May be NULL */) hb_ot_name_id_t *first_param_id /* OUT. May be NULL */)
{ {
const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag); const OT::GSUBGPOS &g = get_gsubgpos_table (face, table_tag);
@ -1141,10 +1141,10 @@ hb_ot_layout_feature_get_name_ids (hb_face_t *face,
{ {
if (label_id) *label_id = ss_params.uiNameID; if (label_id) *label_id = ss_params.uiNameID;
// ssXX features don't have the rest // ssXX features don't have the rest
if (tooltip_id) *tooltip_id = HB_NAME_ID_INVALID; if (tooltip_id) *tooltip_id = HB_OT_NAME_ID_INVALID;
if (sample_id) *sample_id = HB_NAME_ID_INVALID; if (sample_id) *sample_id = HB_OT_NAME_ID_INVALID;
if (num_named_parameters) *num_named_parameters = 0; if (num_named_parameters) *num_named_parameters = 0;
if (first_param_id) *first_param_id = HB_NAME_ID_INVALID; if (first_param_id) *first_param_id = HB_OT_NAME_ID_INVALID;
return true; return true;
} }
const OT::FeatureParamsCharacterVariants& cv_params = const OT::FeatureParamsCharacterVariants& cv_params =
@ -1160,11 +1160,11 @@ hb_ot_layout_feature_get_name_ids (hb_face_t *face,
} }
} }
if (label_id) *label_id = HB_NAME_ID_INVALID; if (label_id) *label_id = HB_OT_NAME_ID_INVALID;
if (tooltip_id) *tooltip_id = HB_NAME_ID_INVALID; if (tooltip_id) *tooltip_id = HB_OT_NAME_ID_INVALID;
if (sample_id) *sample_id = HB_NAME_ID_INVALID; if (sample_id) *sample_id = HB_OT_NAME_ID_INVALID;
if (num_named_parameters) *num_named_parameters = 0; if (num_named_parameters) *num_named_parameters = 0;
if (first_param_id) *first_param_id = HB_NAME_ID_INVALID; if (first_param_id) *first_param_id = HB_OT_NAME_ID_INVALID;
return false; return false;
} }

View File

@ -364,23 +364,23 @@ Xhb_ot_layout_lookup_position (hb_font_t *font,
/* Optical 'size' feature info. Returns true if found. /* Optical 'size' feature info. Returns true if found.
* https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#size */ * https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#size */
HB_EXTERN hb_bool_t HB_EXTERN hb_bool_t
hb_ot_layout_get_size_params (hb_face_t *face, hb_ot_layout_get_size_params (hb_face_t *face,
unsigned int *design_size, /* OUT. May be NULL */ unsigned int *design_size, /* OUT. May be NULL */
unsigned int *subfamily_id, /* OUT. May be NULL */ unsigned int *subfamily_id, /* OUT. May be NULL */
hb_name_id_t *subfamily_name_id, /* OUT. May be NULL */ hb_ot_name_id_t *subfamily_name_id, /* OUT. May be NULL */
unsigned int *range_start, /* OUT. May be NULL */ unsigned int *range_start, /* OUT. May be NULL */
unsigned int *range_end /* OUT. May be NULL */); unsigned int *range_end /* OUT. May be NULL */);
HB_EXTERN hb_bool_t HB_EXTERN hb_bool_t
hb_ot_layout_feature_get_name_ids (hb_face_t *face, hb_ot_layout_feature_get_name_ids (hb_face_t *face,
hb_tag_t table_tag, hb_tag_t table_tag,
unsigned int feature_index, unsigned int feature_index,
hb_name_id_t *label_id /* OUT. May be NULL */, hb_ot_name_id_t *label_id /* OUT. May be NULL */,
hb_name_id_t *tooltip_id /* OUT. May be NULL */, hb_ot_name_id_t *tooltip_id /* OUT. May be NULL */,
hb_name_id_t *sample_id /* OUT. May be NULL */, hb_ot_name_id_t *sample_id /* OUT. May be NULL */,
unsigned int *num_named_parameters /* OUT. May be NULL */, unsigned int *num_named_parameters /* OUT. May be NULL */,
hb_name_id_t *first_param_id /* OUT. May be NULL */); hb_ot_name_id_t *first_param_id /* OUT. May be NULL */);
HB_EXTERN unsigned int HB_EXTERN unsigned int

View File

@ -224,9 +224,9 @@ struct name
hb_blob_destroy (this->blob); hb_blob_destroy (this->blob);
} }
inline int get_index (hb_name_id_t name_id, inline int get_index (hb_ot_name_id_t name_id,
hb_language_t language, hb_language_t language,
unsigned int *width=nullptr) const unsigned int *width=nullptr) const
{ {
const hb_ot_name_entry_t key = {name_id, {0}, language}; const hb_ot_name_entry_t key = {name_id, {0}, language};
const hb_ot_name_entry_t *entry = (const hb_ot_name_entry_t *) const hb_ot_name_entry_t *entry = (const hb_ot_name_entry_t *)

View File

@ -118,10 +118,10 @@ hb_ot_name_convert_utf (const hb_bytes_t *bytes,
template <typename utf_t> template <typename utf_t>
static inline unsigned int static inline unsigned int
hb_ot_name_get_utf (hb_face_t *face, hb_ot_name_get_utf (hb_face_t *face,
hb_name_id_t name_id, hb_ot_name_id_t name_id,
hb_language_t language, hb_language_t language,
unsigned int *text_size /* IN/OUT */, unsigned int *text_size /* IN/OUT */,
typename utf_t::codepoint_t *text /* OUT */) typename utf_t::codepoint_t *text /* OUT */)
{ {
const OT::name_accelerator_t &name = _get_name (face); const OT::name_accelerator_t &name = _get_name (face);
@ -168,11 +168,11 @@ hb_ot_name_get_utf (hb_face_t *face,
* Since: 2.1.0 * Since: 2.1.0
**/ **/
unsigned int unsigned int
hb_ot_name_get_utf8 (hb_face_t *face, hb_ot_name_get_utf8 (hb_face_t *face,
hb_name_id_t name_id, hb_ot_name_id_t name_id,
hb_language_t language, hb_language_t language,
unsigned int *text_size /* IN/OUT */, unsigned int *text_size /* IN/OUT */,
char *text /* OUT */) char *text /* OUT */)
{ {
return hb_ot_name_get_utf<hb_utf8_t> (face, name_id, language, text_size, return hb_ot_name_get_utf<hb_utf8_t> (face, name_id, language, text_size,
(hb_utf8_t::codepoint_t *) text); (hb_utf8_t::codepoint_t *) text);
@ -195,11 +195,11 @@ hb_ot_name_get_utf8 (hb_face_t *face,
* Since: 2.1.0 * Since: 2.1.0
**/ **/
unsigned int unsigned int
hb_ot_name_get_utf16 (hb_face_t *face, hb_ot_name_get_utf16 (hb_face_t *face,
hb_name_id_t name_id, hb_ot_name_id_t name_id,
hb_language_t language, hb_language_t language,
unsigned int *text_size /* IN/OUT */, unsigned int *text_size /* IN/OUT */,
uint16_t *text /* OUT */) uint16_t *text /* OUT */)
{ {
return hb_ot_name_get_utf<hb_utf16_t> (face, name_id, language, text_size, text); return hb_ot_name_get_utf<hb_utf16_t> (face, name_id, language, text_size, text);
} }
@ -221,11 +221,11 @@ hb_ot_name_get_utf16 (hb_face_t *face,
* Since: 2.1.0 * Since: 2.1.0
**/ **/
unsigned int unsigned int
hb_ot_name_get_utf32 (hb_face_t *face, hb_ot_name_get_utf32 (hb_face_t *face,
hb_name_id_t name_id, hb_ot_name_id_t name_id,
hb_language_t language, hb_language_t language,
unsigned int *text_size /* IN/OUT */, unsigned int *text_size /* IN/OUT */,
uint32_t *text /* OUT */) uint32_t *text /* OUT */)
{ {
return hb_ot_name_get_utf<hb_utf32_t> (face, name_id, language, text_size, text); return hb_ot_name_get_utf<hb_utf32_t> (face, name_id, language, text_size, text);
} }

View File

@ -35,8 +35,8 @@ HB_BEGIN_DECLS
/** /**
* hb_name_id_t: * hb_ot_name_id_t:
* @HB_NAME_ID_INVALID: Value to represent a nonexistent name ID. * @HB_OT_NAME_ID_INVALID: Value to represent a nonexistent name ID.
* *
* An integral type representing an OpenType 'name' table name identifier. * An integral type representing an OpenType 'name' table name identifier.
* There are predefined name IDs, as well as name IDs return from other * There are predefined name IDs, as well as name IDs return from other
@ -46,37 +46,37 @@ HB_BEGIN_DECLS
**/ **/
enum enum
{ {
HB_NAME_ID_COPYRIGHT = 0, HB_OT_NAME_ID_COPYRIGHT = 0,
HB_NAME_ID_FONT_FAMILY = 1, HB_OT_NAME_ID_FONT_FAMILY = 1,
HB_NAME_ID_FONT_SUBFAMILY = 2, HB_OT_NAME_ID_FONT_SUBFAMILY = 2,
HB_NAME_ID_UNIQUE_ID = 3, HB_OT_NAME_ID_UNIQUE_ID = 3,
HB_NAME_ID_FULL_NAME = 4, HB_OT_NAME_ID_FULL_NAME = 4,
HB_NAME_ID_VERSION_STRING = 5, HB_OT_NAME_ID_VERSION_STRING = 5,
HB_NAME_ID_POSTSCRIPT_NAME = 6, HB_OT_NAME_ID_POSTSCRIPT_NAME = 6,
HB_NAME_ID_TRADEMARK = 7, HB_OT_NAME_ID_TRADEMARK = 7,
HB_NAME_ID_MANUFACTURER = 8, HB_OT_NAME_ID_MANUFACTURER = 8,
HB_NAME_ID_DESIGNER = 9, HB_OT_NAME_ID_DESIGNER = 9,
HB_NAME_ID_DESCRIPTION = 10, HB_OT_NAME_ID_DESCRIPTION = 10,
HB_NAME_ID_VENDOR_URL = 11, HB_OT_NAME_ID_VENDOR_URL = 11,
HB_NAME_ID_DESIGNER_URL = 12, HB_OT_NAME_ID_DESIGNER_URL = 12,
HB_NAME_ID_LICENSE = 13, HB_OT_NAME_ID_LICENSE = 13,
HB_NAME_ID_LICENSE_URL = 14, HB_OT_NAME_ID_LICENSE_URL = 14,
/*HB_NAME_ID_RESERVED = 15,*/ /*HB_OT_NAME_ID_RESERVED = 15,*/
HB_NAME_ID_TYPOGRAPHIC_FAMILY = 16, HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY = 16,
HB_NAME_ID_TYPOGRAPHIC_SUBFAMILY = 17, HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY = 17,
HB_NAME_ID_MAC_FULL_NAME = 18, HB_OT_NAME_ID_MAC_FULL_NAME = 18,
HB_NAME_ID_SAMPLE_TEXT = 19, HB_OT_NAME_ID_SAMPLE_TEXT = 19,
HB_NAME_ID_CID_FINDFONT_NAME = 20, HB_OT_NAME_ID_CID_FINDFONT_NAME = 20,
HB_NAME_ID_WWS_FAMILY = 21, HB_OT_NAME_ID_WWS_FAMILY = 21,
HB_NAME_ID_WWS_SUBFAMILY = 22, HB_OT_NAME_ID_WWS_SUBFAMILY = 22,
HB_NAME_ID_LIGHT_BACKGROUND = 23, HB_OT_NAME_ID_LIGHT_BACKGROUND = 23,
HB_NAME_ID_DARK_BACKGROUND = 24, HB_OT_NAME_ID_DARK_BACKGROUND = 24,
HB_NAME_ID_VARIATIONS_PS_PREFIX = 25, HB_OT_NAME_ID_VARIATIONS_PS_PREFIX = 25,
HB_NAME_ID_INVALID = 0xFFFF, HB_OT_NAME_ID_INVALID = 0xFFFF,
}; };
typedef unsigned int hb_name_id_t; typedef unsigned int hb_ot_name_id_t;
/** /**
@ -90,11 +90,11 @@ typedef unsigned int hb_name_id_t;
**/ **/
typedef struct hb_ot_name_entry_t typedef struct hb_ot_name_entry_t
{ {
hb_name_id_t name_id; hb_ot_name_id_t name_id;
/*< private >*/ /*< private >*/
hb_var_int_t var; hb_var_int_t var;
/*< public >*/ /*< public >*/
hb_language_t language; hb_language_t language;
} hb_ot_name_entry_t; } hb_ot_name_entry_t;
HB_EXTERN const hb_ot_name_entry_t * HB_EXTERN const hb_ot_name_entry_t *
@ -103,25 +103,25 @@ hb_ot_name_list_names (hb_face_t *face,
HB_EXTERN unsigned int HB_EXTERN unsigned int
hb_ot_name_get_utf8 (hb_face_t *face, hb_ot_name_get_utf8 (hb_face_t *face,
hb_name_id_t name_id, hb_ot_name_id_t name_id,
hb_language_t language, hb_language_t language,
unsigned int *text_size /* IN/OUT */, unsigned int *text_size /* IN/OUT */,
char *text /* OUT */); char *text /* OUT */);
HB_EXTERN unsigned int HB_EXTERN unsigned int
hb_ot_name_get_utf16 (hb_face_t *face, hb_ot_name_get_utf16 (hb_face_t *face,
hb_name_id_t name_id, hb_ot_name_id_t name_id,
hb_language_t language, hb_language_t language,
unsigned int *text_size /* IN/OUT */, unsigned int *text_size /* IN/OUT */,
uint16_t *text /* OUT */); uint16_t *text /* OUT */);
HB_EXTERN unsigned int HB_EXTERN unsigned int
hb_ot_name_get_utf32 (hb_face_t *face, hb_ot_name_get_utf32 (hb_face_t *face,
hb_name_id_t name_id, hb_ot_name_id_t name_id,
hb_language_t language, hb_language_t language,
unsigned int *text_size /* IN/OUT */, unsigned int *text_size /* IN/OUT */,
uint32_t *text /* OUT */); uint32_t *text /* OUT */);
HB_END_DECLS HB_END_DECLS

View File

@ -141,19 +141,19 @@ static void
test_hb_ot_color_palette_get_name_id_empty (void) test_hb_ot_color_palette_get_name_id_empty (void)
{ {
/* numPalettes=0, so all calls are for out-of-bounds palette indices */ /* numPalettes=0, so all calls are for out-of-bounds palette indices */
g_assert_cmpint (hb_ot_color_palette_get_name_id (hb_face_get_empty(), 0), ==, HB_NAME_ID_INVALID); g_assert_cmpint (hb_ot_color_palette_get_name_id (hb_face_get_empty(), 0), ==, HB_OT_NAME_ID_INVALID);
g_assert_cmpint (hb_ot_color_palette_get_name_id (hb_face_get_empty(), 1), ==, HB_NAME_ID_INVALID); g_assert_cmpint (hb_ot_color_palette_get_name_id (hb_face_get_empty(), 1), ==, HB_OT_NAME_ID_INVALID);
} }
static void static void
test_hb_ot_color_palette_get_name_id_v0 (void) test_hb_ot_color_palette_get_name_id_v0 (void)
{ {
g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 0), ==, HB_NAME_ID_INVALID); g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 0), ==, HB_OT_NAME_ID_INVALID);
g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 1), ==, HB_NAME_ID_INVALID); g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 1), ==, HB_OT_NAME_ID_INVALID);
/* numPalettes=2, so palette #2 is out of bounds */ /* numPalettes=2, so palette #2 is out of bounds */
g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 2), ==, HB_NAME_ID_INVALID); g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v0, 2), ==, HB_OT_NAME_ID_INVALID);
} }
@ -161,11 +161,11 @@ static void
test_hb_ot_color_palette_get_name_id_v1 (void) test_hb_ot_color_palette_get_name_id_v1 (void)
{ {
g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 0), ==, 257); g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 0), ==, 257);
g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 1), ==, HB_NAME_ID_INVALID); g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 1), ==, HB_OT_NAME_ID_INVALID);
g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 2), ==, 258); g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 2), ==, 258);
/* numPalettes=3, so palette #3 is out of bounds */ /* numPalettes=3, so palette #3 is out of bounds */
g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 3), ==, HB_NAME_ID_INVALID); g_assert_cmpint (hb_ot_color_palette_get_name_id (cpal_v1, 3), ==, HB_OT_NAME_ID_INVALID);
} }
@ -302,15 +302,15 @@ test_hb_ot_color_palette_get_colors_v1 (void)
static void static void
test_hb_ot_color_palette_color_get_name_id (void) test_hb_ot_color_palette_color_get_name_id (void)
{ {
g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 0), ==, HB_NAME_ID_INVALID); g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 0), ==, HB_OT_NAME_ID_INVALID);
g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 1), ==, HB_NAME_ID_INVALID); g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 1), ==, HB_OT_NAME_ID_INVALID);
g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 2), ==, HB_NAME_ID_INVALID); g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (empty, 2), ==, HB_OT_NAME_ID_INVALID);
g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 0), ==, HB_NAME_ID_INVALID); g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 0), ==, HB_OT_NAME_ID_INVALID);
g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 1), ==, HB_NAME_ID_INVALID); g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 1), ==, HB_OT_NAME_ID_INVALID);
g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 2), ==, HB_NAME_ID_INVALID); g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v0, 2), ==, HB_OT_NAME_ID_INVALID);
g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 0), ==, HB_NAME_ID_INVALID); g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 0), ==, HB_OT_NAME_ID_INVALID);
g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 1), ==, 256); g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 1), ==, 256);
g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 2), ==, HB_NAME_ID_INVALID); g_assert_cmpuint (hb_ot_color_palette_color_get_name_id (cpal_v1, 2), ==, HB_OT_NAME_ID_INVALID);
} }

View File

@ -41,11 +41,11 @@ test_ot_layout_feature_get_name_ids_and_characters (void)
&feature_index)) &feature_index))
g_error ("Failed to find feature index"); g_error ("Failed to find feature index");
hb_name_id_t label_id; hb_ot_name_id_t label_id;
hb_name_id_t tooltip_id; hb_ot_name_id_t tooltip_id;
hb_name_id_t sample_id; hb_ot_name_id_t sample_id;
unsigned int num_named_parameters; unsigned int num_named_parameters;
hb_name_id_t first_param_id; hb_ot_name_id_t first_param_id;
if (!hb_ot_layout_feature_get_name_ids (face, HB_OT_TAG_GSUB, feature_index, if (!hb_ot_layout_feature_get_name_ids (face, HB_OT_TAG_GSUB, feature_index,
&label_id, &tooltip_id, &sample_id, &label_id, &tooltip_id, &sample_id,
&num_named_parameters, &first_param_id)) &num_named_parameters, &first_param_id))