[meta] Rename hb_ot_meta_t to hb_ot_meta_tag_t

This commit is contained in:
Ebrahim Byagowi 2019-07-29 22:01:13 +04:30
parent 7bcc5dfa97
commit 2c2a2b97db
5 changed files with 22 additions and 22 deletions

View File

@ -32,7 +32,7 @@
* https://docs.microsoft.com/en-us/typography/opentype/spec/meta
* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6meta.html
*/
#define HB_OT_TAG_meta HB_TAG('m','e','t','a')
#define HB_OT_TAG_meta HB_TAG ('m','e','t','a')
namespace OT {
@ -78,15 +78,15 @@ struct meta
hb_blob_t *reference_entry (hb_tag_t tag) const
{ return table->dataMaps.lsearch (tag).reference_entry (table.get_blob ()); }
unsigned int get_entries (unsigned int start_offset,
unsigned int *count,
hb_ot_meta_t *entries) const
unsigned int get_entries (unsigned int start_offset,
unsigned int *count,
hb_ot_meta_tag_t *entries) const
{
if (count)
{
hb_array_t<const DataMap> arr = table->dataMaps.sub_array (start_offset, count);
for (unsigned int i = 0; i < arr.length; i++)
entries[i] = (hb_ot_meta_t) arr[i].get_tag ();
entries[i] = (hb_ot_meta_tag_t) arr[i].get_tag ();
}
return table->dataMaps.len;
}

View File

@ -49,10 +49,10 @@
* Since: REPLACEME
**/
unsigned int
hb_ot_meta_get_entries (hb_face_t *face,
unsigned int start_offset,
unsigned int *entries_count, /* IN/OUT. May be NULL. */
hb_ot_meta_t *entries /* OUT. May be NULL. */)
hb_ot_meta_get_entries (hb_face_t *face,
unsigned int start_offset,
unsigned int *entries_count, /* IN/OUT. May be NULL. */
hb_ot_meta_tag_t *entries /* OUT. May be NULL. */)
{
return face->table.meta->get_entries (start_offset, entries_count, entries);
}
@ -69,7 +69,7 @@ hb_ot_meta_get_entries (hb_face_t *face,
* Since: REPLACEME
**/
hb_blob_t *
hb_ot_meta_reference_entry (hb_face_t *face, hb_ot_meta_t meta_tag)
hb_ot_meta_reference_entry (hb_face_t *face, hb_ot_meta_tag_t meta_tag)
{
return face->table.meta->reference_entry (meta_tag);
}

View File

@ -34,7 +34,7 @@
HB_BEGIN_DECLS
/**
* hb_ot_meta_t:
* hb_ot_meta_tag_t:
*
* From https://docs.microsoft.com/en-us/typography/opentype/spec/meta
*
@ -49,16 +49,16 @@ typedef enum {
HB_OT_META_SUPPORTED_LANGUAGES= HB_TAG ('s','l','n','g'),
_HB_OT_META_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/
} hb_ot_meta_t;
} hb_ot_meta_tag_t;
HB_EXTERN unsigned int
hb_ot_meta_get_entries (hb_face_t *face,
unsigned int start_offset,
unsigned int *entries_count, /* IN/OUT. May be NULL. */
hb_ot_meta_t *entries /* OUT. May be NULL. */);
hb_ot_meta_get_entries (hb_face_t *face,
unsigned int start_offset,
unsigned int *entries_count, /* IN/OUT. May be NULL. */
hb_ot_meta_tag_t *entries /* OUT. May be NULL. */);
HB_EXTERN hb_blob_t *
hb_ot_meta_reference_entry (hb_face_t *face, hb_ot_meta_t meta_tag);
hb_ot_meta_reference_entry (hb_face_t *face, hb_ot_meta_tag_t meta_tag);
HB_END_DECLS

View File

@ -50,8 +50,8 @@ main (int argc, char **argv)
#ifndef HB_NO_META
count = hb_ot_meta_get_entries (face, 0, nullptr, nullptr);
hb_ot_meta_t *tags = (hb_ot_meta_t *)
malloc (sizeof (hb_ot_meta_t) * count);
hb_ot_meta_tag_t *tags = (hb_ot_meta_tag_t *)
malloc (sizeof (hb_ot_meta_tag_t) * count);
hb_ot_meta_get_entries (face, 0, &count, tags);
for (unsigned i = 0; i < count; ++i)
{

View File

@ -32,7 +32,7 @@ static void
test_ot_meta_get_entries (void)
{
hb_face_t *face = hb_test_open_font_file ("fonts/meta.ttf");
hb_ot_meta_t entries[2];
hb_ot_meta_tag_t entries[2];
unsigned int entries_count = 2;
g_assert_cmpint (hb_ot_meta_get_entries (face, 0, &entries_count, entries), ==, 5);
@ -61,10 +61,10 @@ test_ot_meta_reference_entry (void)
g_assert_cmpint (hb_blob_get_length (dlng), ==, 8);
g_assert_cmpmem (hb_blob_get_data (dlng, NULL), 8, "ar,de,fa", 8);
hb_blob_destroy (dlng);
hb_blob_t *fslf = hb_ot_meta_reference_entry (face, (hb_ot_meta_t) HB_TAG ('f','s','l','f'));
hb_blob_t *fslf = hb_ot_meta_reference_entry (face, (hb_ot_meta_tag_t) HB_TAG ('f','s','l','f'));
g_assert_cmpint (hb_blob_get_length (fslf), ==, 12);
hb_blob_destroy (fslf);
hb_blob_t *nacl = hb_ot_meta_reference_entry (face, (hb_ot_meta_t) HB_TAG ('n','a','c','l'));
hb_blob_t *nacl = hb_ot_meta_reference_entry (face, (hb_ot_meta_tag_t) HB_TAG ('n','a','c','l'));
g_assert_cmpint (hb_blob_get_length (nacl), ==, 0);
hb_blob_destroy (nacl);
hb_blob_t *slng = hb_ot_meta_reference_entry (face, HB_OT_META_SUPPORTED_LANGUAGES);