diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index 888859e28..99916ebe2 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -608,9 +608,10 @@ hb_ot_math_get_glyph_assembly
-hb-ot-metadata -hb_ot_metadata_reference_entry -hb_ot_metadata_t +hb-ot-meta +hb_ot_meta_t +hb_ot_meta_get_entries +hb_ot_meta_reference_entry
diff --git a/src/Makefile.am b/src/Makefile.am index 84b51ac3e..7173f4b7d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -332,7 +332,7 @@ noinst_PROGRAMS = \ main \ test \ test-buffer-serialize \ - test-ot-metadata \ + test-ot-meta \ test-ot-name \ test-gpos-size-params \ test-gsub-would-substitute \ @@ -351,9 +351,9 @@ test_buffer_serialize_SOURCES = test-buffer-serialize.cc test_buffer_serialize_CPPFLAGS = $(HBCFLAGS) test_buffer_serialize_LDADD = libharfbuzz.la $(HBLIBS) -test_ot_metadata_SOURCES = test-ot-metadata.cc -test_ot_metadata_CPPFLAGS = $(HBCFLAGS) -test_ot_metadata_LDADD = libharfbuzz.la $(HBLIBS) +test_ot_meta_SOURCES = test-ot-meta.cc +test_ot_meta_CPPFLAGS = $(HBCFLAGS) +test_ot_meta_LDADD = libharfbuzz.la $(HBLIBS) test_ot_name_SOURCES = test-ot-name.cc test_ot_name_CPPFLAGS = $(HBCFLAGS) diff --git a/src/Makefile.sources b/src/Makefile.sources index a024381ab..a8369bf1a 100644 --- a/src/Makefile.sources +++ b/src/Makefile.sources @@ -89,7 +89,7 @@ HB_BASE_sources = \ hb-ot-math.cc \ hb-ot-maxp-table.hh \ hb-ot-meta-table.hh \ - hb-ot-metadata.cc \ + hb-ot-meta.cc \ hb-ot-metrics.cc \ hb-ot-metrics.hh \ hb-ot-name-language-static.hh \ @@ -195,7 +195,7 @@ HB_BASE_headers = \ hb-ot-font.h \ hb-ot-layout.h \ hb-ot-math.h \ - hb-ot-metadata.h \ + hb-ot-meta.h \ hb-ot-metrics.h \ hb-ot-name.h \ hb-ot-shape.h \ diff --git a/src/harfbuzz.cc b/src/harfbuzz.cc index d97143981..d338d1735 100644 --- a/src/harfbuzz.cc +++ b/src/harfbuzz.cc @@ -16,7 +16,7 @@ #include "hb-ot-layout.cc" #include "hb-ot-map.cc" #include "hb-ot-math.cc" -#include "hb-ot-metadata.cc" +#include "hb-ot-meta.cc" #include "hb-ot-metrics.cc" #include "hb-ot-name.cc" #include "hb-ot-shape-complex-arabic.cc" diff --git a/src/hb-ot-meta-table.hh b/src/hb-ot-meta-table.hh index a7bd7bffc..cc31bfb32 100644 --- a/src/hb-ot-meta-table.hh +++ b/src/hb-ot-meta-table.hh @@ -78,15 +78,15 @@ struct meta hb_blob_t *reference_entry (hb_tag_t tag) const { return table->dataMaps.lsearch (tag, Null (DataMap)).reference_entry (table.get_blob ()); } - unsigned int get_entries (unsigned int start_offset, - unsigned int *count, - hb_ot_metadata_t *entries) const + unsigned int get_entries (unsigned int start_offset, + unsigned int *count, + hb_ot_meta_t *entries) const { if (count && *count) { hb_array_t array = table->dataMaps.sub_array (start_offset, count); for (unsigned int i = 0; i < *count; i++) - entries[i] = (hb_ot_metadata_t) array[i].get_tag (); + entries[i] = (hb_ot_meta_t) array[i].get_tag (); } return table->dataMaps.len; } diff --git a/src/hb-ot-metadata.cc b/src/hb-ot-meta.cc similarity index 77% rename from src/hb-ot-metadata.cc rename to src/hb-ot-meta.cc index 8ad602a91..78eca6829 100644 --- a/src/hb-ot-metadata.cc +++ b/src/hb-ot-meta.cc @@ -29,8 +29,8 @@ #include "hb-ot-meta-table.hh" /** - * SECTION:hb-ot-metadata - * @title: hb-ot-metadata + * SECTION:hb-ot-meta + * @title: hb-ot-meta * @short_description: OpenType Metadata * @include: hb-ot.h * @@ -38,7 +38,7 @@ **/ /** - * hb_ot_metadata_reference_entry: + * hb_ot_meta_reference_entry: * @face: a face object * @start_offset: iteration's start offset * @entries_count:(inout) (allow-none): buffer size as input, filled size as output @@ -49,18 +49,18 @@ * Since: REPLACEME **/ unsigned int -hb_ot_metadata_get_entries (hb_face_t *face, - unsigned int start_offset, - unsigned int *entries_count, /* IN/OUT. May be NULL. */ - hb_ot_metadata_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_t *entries /* OUT. May be NULL. */) { return face->table.meta->get_entries (start_offset, entries_count, entries); } /** - * hb_ot_metadata_reference_entry: + * hb_ot_meta_reference_entry: * @face: a #hb_face_t object. - * @metadata_tag: tag of metadata you like to have. + * @meta_tag: tag of metadata you like to have. * * It fetches metadata entry of a given tag from a font. * @@ -69,9 +69,9 @@ hb_ot_metadata_get_entries (hb_face_t *face, * Since: REPLACEME **/ hb_blob_t * -hb_ot_metadata_reference_entry (hb_face_t *face, hb_ot_metadata_t metadata_tag) +hb_ot_meta_reference_entry (hb_face_t *face, hb_ot_meta_t meta_tag) { - return face->table.meta->reference_entry (metadata_tag); + return face->table.meta->reference_entry (meta_tag); } #endif diff --git a/src/hb-ot-metadata.h b/src/hb-ot-meta.h similarity index 65% rename from src/hb-ot-metadata.h rename to src/hb-ot-meta.h index 71e92a81f..e80273a7b 100644 --- a/src/hb-ot-metadata.h +++ b/src/hb-ot-meta.h @@ -26,15 +26,15 @@ #error "Include instead." #endif -#ifndef HB_OT_METADATA_H -#define HB_OT_METADATA_H +#ifndef HB_OT_META_H +#define HB_OT_META_H #include "hb.h" HB_BEGIN_DECLS /** - * hb_ot_metadata_t: + * hb_ot_meta_t: * * From https://docs.microsoft.com/en-us/typography/opentype/spec/meta * @@ -42,24 +42,24 @@ HB_BEGIN_DECLS **/ typedef enum { /* - HB_OT_METADATA_APPL = HB_TAG ('a','p','p','l'), - HB_OT_METADATA_BILD = HB_TAG ('b','i','l','d'), + HB_OT_META_APPL = HB_TAG ('a','p','p','l'), + HB_OT_META_BILD = HB_TAG ('b','i','l','d'), */ - HB_OT_METADATA_DESIGN_LANGUAGES = HB_TAG ('d','l','n','g'), - HB_OT_METADATA_SUPPORTED_LANGUAGES = HB_TAG ('s','l','n','g'), + HB_OT_META_DESIGN_LANGUAGES = HB_TAG ('d','l','n','g'), + HB_OT_META_SUPPORTED_LANGUAGES= HB_TAG ('s','l','n','g'), - _HB_OT_METADATA_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/ -} hb_ot_metadata_t; + _HB_OT_META_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/ +} hb_ot_meta_t; HB_EXTERN unsigned int -hb_ot_metadata_get_entries (hb_face_t *face, - unsigned int start_offset, - unsigned int *entries_count, /* IN/OUT. May be NULL. */ - hb_ot_metadata_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_t *entries /* OUT. May be NULL. */); HB_EXTERN hb_blob_t * -hb_ot_metadata_reference_entry (hb_face_t *face, hb_ot_metadata_t metadata_tag); +hb_ot_meta_reference_entry (hb_face_t *face, hb_ot_meta_t meta_tag); HB_END_DECLS -#endif /* HB_OT_METADATA_H */ +#endif /* HB_OT_META_H */ diff --git a/src/hb-ot.h b/src/hb-ot.h index 411d0936f..f2dbaa1b3 100644 --- a/src/hb-ot.h +++ b/src/hb-ot.h @@ -35,7 +35,7 @@ #include "hb-ot-font.h" #include "hb-ot-layout.h" #include "hb-ot-math.h" -#include "hb-ot-metadata.h" +#include "hb-ot-meta.h" #include "hb-ot-metrics.h" #include "hb-ot-name.h" #include "hb-ot-shape.h" diff --git a/src/test-ot-metadata.cc b/src/test-ot-meta.cc similarity index 86% rename from src/test-ot-metadata.cc rename to src/test-ot-meta.cc index 5c9e85210..33b1ee94e 100644 --- a/src/test-ot-metadata.cc +++ b/src/test-ot-meta.cc @@ -48,14 +48,14 @@ main (int argc, char **argv) unsigned int count = 0; #ifndef HB_NO_META - count = hb_ot_metadata_get_entries (face, 0, nullptr, nullptr); + count = hb_ot_meta_get_entries (face, 0, nullptr, nullptr); - hb_ot_metadata_t *tags = (hb_ot_metadata_t *) - malloc (sizeof (hb_ot_metadata_t) * count); - hb_ot_metadata_get_entries (face, 0, &count, tags); + hb_ot_meta_t *tags = (hb_ot_meta_t *) + malloc (sizeof (hb_ot_meta_t) * count); + hb_ot_meta_get_entries (face, 0, &count, tags); for (unsigned i = 0; i < count; ++i) { - hb_blob_t *entry = hb_ot_metadata_reference_entry (face, tags[i]); + hb_blob_t *entry = hb_ot_meta_reference_entry (face, tags[i]); printf ("%c%c%c%c, size: %d: %.*s\n", HB_UNTAG (tags[i]), hb_blob_get_length (entry), hb_blob_get_length (entry), hb_blob_get_data (entry, nullptr)); diff --git a/test/api/Makefile.am b/test/api/Makefile.am index a675c50ff..2386e53ea 100644 --- a/test/api/Makefile.am +++ b/test/api/Makefile.am @@ -84,7 +84,7 @@ TEST_PROGS += \ test-ot-color \ test-ot-ligature-carets \ test-ot-name \ - test-ot-metadata \ + test-ot-meta \ test-ot-metrics \ test-ot-tag \ test-ot-extents-cff \ diff --git a/test/api/test-ot-metadata.c b/test/api/test-ot-meta.c similarity index 72% rename from test/api/test-ot-metadata.c rename to test/api/test-ot-meta.c index f0e633e50..a08e67dc5 100644 --- a/test/api/test-ot-metadata.c +++ b/test/api/test-ot-meta.c @@ -26,27 +26,27 @@ #include -/* Unit tests for hb-ot-metadata.h */ +/* Unit tests for hb-ot-meta.h */ static void -test_ot_metadata_get_entries (void) +test_ot_meta_get_entries (void) { hb_face_t *face = hb_test_open_font_file ("fonts/meta.ttf"); - hb_ot_metadata_t entries[2]; + hb_ot_meta_t entries[2]; unsigned int entries_count = 2; - g_assert_cmpint (hb_ot_metadata_get_entries (face, 0, &entries_count, entries), ==, 5); + g_assert_cmpint (hb_ot_meta_get_entries (face, 0, &entries_count, entries), ==, 5); g_assert_cmpint (entries_count, ==, 2); g_assert_cmpint (entries[0], ==, HB_TAG ('a','p','p','l')); g_assert_cmpint (entries[1], ==, HB_TAG ('b','i','l','d')); entries_count = 1; - g_assert_cmpint (hb_ot_metadata_get_entries (face, 2, &entries_count, entries), ==, 5); + g_assert_cmpint (hb_ot_meta_get_entries (face, 2, &entries_count, entries), ==, 5); g_assert_cmpint (entries_count, ==, 1); g_assert_cmpint (entries[0], ==, HB_TAG ('d','l','n','g')); entries_count = 2; - g_assert_cmpint (hb_ot_metadata_get_entries (face, 4, &entries_count, entries), ==, 5); + g_assert_cmpint (hb_ot_meta_get_entries (face, 4, &entries_count, entries), ==, 5); g_assert_cmpint (entries_count, ==, 1); g_assert_cmpint (entries[0], ==, HB_TAG ('s','l','n','g')); @@ -54,20 +54,20 @@ test_ot_metadata_get_entries (void) } static void -test_ot_metadata_reference_entry (void) +test_ot_meta_reference_entry (void) { hb_face_t *face = hb_test_open_font_file ("fonts/meta.ttf"); - hb_blob_t *dlng = hb_ot_metadata_reference_entry (face, HB_OT_METADATA_DESIGN_LANGUAGES); + hb_blob_t *dlng = hb_ot_meta_reference_entry (face, HB_OT_META_DESIGN_LANGUAGES); 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_metadata_reference_entry (face, (hb_ot_metadata_t) HB_TAG ('f','s','l','f')); + hb_blob_t *fslf = hb_ot_meta_reference_entry (face, (hb_ot_meta_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_metadata_reference_entry (face, (hb_ot_metadata_t) HB_TAG ('n','a','c','l')); + hb_blob_t *nacl = hb_ot_meta_reference_entry (face, (hb_ot_meta_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_metadata_reference_entry (face, HB_OT_METADATA_SUPPORTED_LANGUAGES); + hb_blob_t *slng = hb_ot_meta_reference_entry (face, HB_OT_META_SUPPORTED_LANGUAGES); g_assert_cmpint (hb_blob_get_length (slng), ==, 11); g_assert_cmpmem (hb_blob_get_data (slng, NULL), 11, "ar,de,en,fa", 11); hb_blob_destroy (slng); @@ -78,7 +78,7 @@ int main (int argc, char **argv) { hb_test_init (&argc, &argv); - hb_test_add (test_ot_metadata_get_entries); - hb_test_add (test_ot_metadata_reference_entry); + hb_test_add (test_ot_meta_get_entries); + hb_test_add (test_ot_meta_reference_entry); return hb_test_run (); }