[subset] remove unsed table_entry struct.

This commit is contained in:
Garret Rieger 2021-08-04 16:42:49 -07:00 committed by Behdad Esfahbod
parent dea0fe5717
commit c2ee1fdd40
942 changed files with 21 additions and 32 deletions
src
test/subset/data/expected/basics
Comfortaa-Regular-new.default.61,62,63.ttfComfortaa-Regular-new.default.61,63.ttfComfortaa-Regular-new.default.61.ttfComfortaa-Regular-new.default.62.ttfComfortaa-Regular-new.default.63.ttfComfortaa-Regular-new.default.retain-all-codepoint.ttfComfortaa-Regular-new.drop-hints-retain-gids.61,62,63.ttfComfortaa-Regular-new.drop-hints-retain-gids.61,63.ttfComfortaa-Regular-new.drop-hints-retain-gids.61.ttfComfortaa-Regular-new.drop-hints-retain-gids.62.ttfComfortaa-Regular-new.drop-hints-retain-gids.63.ttfComfortaa-Regular-new.drop-hints-retain-gids.retain-all-codepoint.ttfComfortaa-Regular-new.drop-hints.61,62,63.ttfComfortaa-Regular-new.drop-hints.61,63.ttfComfortaa-Regular-new.drop-hints.61.ttfComfortaa-Regular-new.drop-hints.62.ttfComfortaa-Regular-new.drop-hints.63.ttfComfortaa-Regular-new.drop-hints.retain-all-codepoint.ttfComfortaa-Regular-new.gids.61,62,63.ttfComfortaa-Regular-new.gids.61,63.ttfComfortaa-Regular-new.gids.61.ttfComfortaa-Regular-new.gids.62.ttfComfortaa-Regular-new.gids.63.ttfComfortaa-Regular-new.gids.retain-all-codepoint.ttfComfortaa-Regular-new.glyph-names.61,62,63.ttfComfortaa-Regular-new.glyph-names.61,63.ttfComfortaa-Regular-new.glyph-names.61.ttfComfortaa-Regular-new.glyph-names.62.ttfComfortaa-Regular-new.glyph-names.63.ttfComfortaa-Regular-new.glyph-names.retain-all-codepoint.ttfComfortaa-Regular-new.keep-all-layout-features.61,62,63.ttfComfortaa-Regular-new.keep-all-layout-features.61,63.ttfComfortaa-Regular-new.keep-all-layout-features.61.ttfComfortaa-Regular-new.keep-all-layout-features.62.ttfComfortaa-Regular-new.keep-all-layout-features.63.ttfComfortaa-Regular-new.keep-all-layout-features.retain-all-codepoint.ttfComfortaa-Regular-new.layout-features.61,62,63.ttfComfortaa-Regular-new.layout-features.61,63.ttfComfortaa-Regular-new.layout-features.61.ttfComfortaa-Regular-new.layout-features.62.ttfComfortaa-Regular-new.layout-features.63.ttfComfortaa-Regular-new.layout-features.retain-all-codepoint.ttfComfortaa-Regular-new.name-ids.61,62,63.ttfComfortaa-Regular-new.name-ids.61,63.ttfComfortaa-Regular-new.name-ids.61.ttfComfortaa-Regular-new.name-ids.62.ttfComfortaa-Regular-new.name-ids.63.ttfComfortaa-Regular-new.name-ids.retain-all-codepoint.ttfComfortaa-Regular-new.name-languages.61,62,63.ttfComfortaa-Regular-new.name-languages.61,63.ttfComfortaa-Regular-new.name-languages.61.ttfComfortaa-Regular-new.name-languages.62.ttfComfortaa-Regular-new.name-languages.63.ttfComfortaa-Regular-new.name-languages.retain-all-codepoint.ttfComfortaa-Regular-new.name-legacy.61,62,63.ttfComfortaa-Regular-new.name-legacy.61,63.ttfComfortaa-Regular-new.name-legacy.61.ttfComfortaa-Regular-new.name-legacy.62.ttfComfortaa-Regular-new.name-legacy.63.ttfComfortaa-Regular-new.name-legacy.retain-all-codepoint.ttfComfortaa-Regular-new.no-prune-unicode-ranges.61,62,63.ttfComfortaa-Regular-new.no-prune-unicode-ranges.61,63.ttfComfortaa-Regular-new.no-prune-unicode-ranges.61.ttfComfortaa-Regular-new.no-prune-unicode-ranges.62.ttfComfortaa-Regular-new.no-prune-unicode-ranges.63.ttfComfortaa-Regular-new.no-prune-unicode-ranges.retain-all-codepoint.ttfComfortaa-Regular-new.notdef-outline.61,62,63.ttfComfortaa-Regular-new.notdef-outline.61,63.ttfComfortaa-Regular-new.notdef-outline.61.ttfComfortaa-Regular-new.notdef-outline.62.ttfComfortaa-Regular-new.notdef-outline.63.ttfComfortaa-Regular-new.notdef-outline.retain-all-codepoint.ttfComfortaa-Regular-new.retain-gids.61,62,63.ttfComfortaa-Regular-new.retain-gids.61,63.ttfComfortaa-Regular-new.retain-gids.61.ttfComfortaa-Regular-new.retain-gids.62.ttfComfortaa-Regular-new.retain-gids.63.ttfComfortaa-Regular-new.retain-gids.retain-all-codepoint.ttfNanumMyeongjo-Regular-subset.default.61,62,63.ttfNanumMyeongjo-Regular-subset.default.61,63.ttfNanumMyeongjo-Regular-subset.default.61.ttfNanumMyeongjo-Regular-subset.default.62.ttfNanumMyeongjo-Regular-subset.default.63.ttfNanumMyeongjo-Regular-subset.default.retain-all-codepoint.ttfNanumMyeongjo-Regular-subset.drop-hints-retain-gids.61,62,63.ttfNanumMyeongjo-Regular-subset.drop-hints-retain-gids.61,63.ttfNanumMyeongjo-Regular-subset.drop-hints-retain-gids.61.ttfNanumMyeongjo-Regular-subset.drop-hints-retain-gids.62.ttfNanumMyeongjo-Regular-subset.drop-hints-retain-gids.63.ttfNanumMyeongjo-Regular-subset.drop-hints-retain-gids.retain-all-codepoint.ttfNanumMyeongjo-Regular-subset.drop-hints.61,62,63.ttfNanumMyeongjo-Regular-subset.drop-hints.61,63.ttfNanumMyeongjo-Regular-subset.drop-hints.61.ttfNanumMyeongjo-Regular-subset.drop-hints.62.ttfNanumMyeongjo-Regular-subset.drop-hints.63.ttfNanumMyeongjo-Regular-subset.drop-hints.retain-all-codepoint.ttfNanumMyeongjo-Regular-subset.gids.61,62,63.ttfNanumMyeongjo-Regular-subset.gids.61,63.ttf

View File

@ -624,22 +624,23 @@ hb_face_collect_variation_unicodes (hb_face_t *face,
struct hb_face_builder_data_t
{
struct table_entry_t
{
int cmp (hb_tag_t t) const
{
if (t < tag) return -1;
if (t > tag) return -1;
return 0;
}
hb_tag_t tag;
hb_blob_t *blob;
};
hb_hashmap_t<hb_tag_t, hb_blob_t*, (unsigned)-1, nullptr> tables;
};
static int compare_entries (const void* a, const void* b)
{
hb_pair_t <hb_tag_t, hb_blob_t*>* pair_a = (hb_pair_t <hb_tag_t, hb_blob_t*>*) a;
hb_pair_t <hb_tag_t, hb_blob_t*>* pair_b = (hb_pair_t <hb_tag_t, hb_blob_t*>*) b;
// Order by blob size first (smallest to largest) and then table tag.
if (hb_blob_get_length (pair_a->second) < hb_blob_get_length (pair_b->second)) return -1;
if (hb_blob_get_length (pair_a->second) > hb_blob_get_length (pair_b->second)) return 1;
if (pair_a->first < pair_b->first) return -1;
if (pair_a->first > pair_b->first) return 1;
return 0;
}
static hb_face_builder_data_t *
_hb_face_builder_data_create ()
{
@ -688,18 +689,10 @@ _hb_face_builder_data_reference_blob (hb_face_builder_data_t *data)
hb_tag_t sfnt_tag = is_cff ? OT::OpenTypeFontFile::CFFTag : OT::OpenTypeFontFile::TrueTypeTag;
// Sort the tags so that produced face is deterministic.
hb_set_t tags;
+ data->tables.keys()
| hb_sink (tags)
;
auto it =
+ tags.iter()
| hb_map ([&] (hb_tag_t _) {
return hb_pair (_, data->tables[_]);
})
;
bool ret = f->serialize_single (&c, sfnt_tag, it);
hb_vector_t<hb_pair_t <hb_tag_t, hb_blob_t*>> sorted_entries;
data->tables.iter () | hb_sink (sorted_entries);
sorted_entries.qsort (compare_entries);
bool ret = f->serialize_single (&c, sfnt_tag, + sorted_entries.iter());
c.end_serialize ();
@ -720,10 +713,7 @@ _hb_face_builder_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void
if (!tag)
return _hb_face_builder_data_reference_blob (data);
if (data->tables.has (tag))
return hb_blob_reference (data->tables[tag]);
return nullptr;
return hb_blob_reference (data->tables[tag]);
}

View File

@ -35,7 +35,6 @@
namespace OT {
/*
*
* The OpenType Font File
@ -119,7 +118,7 @@ typedef struct OpenTypeOffsetTable
public:
template <typename Iterator>
template <typename Iterator, hb_requires (hb_is_iterator(Iterator))>
bool serialize (hb_serialize_context_t *c,
hb_tag_t sfnt_tag,
Iterator it)
@ -492,7 +491,7 @@ struct OpenTypeFontFile
}
}
template <typename Iterator>
template <typename Iterator, hb_requires (hb_is_iterator (Iterator))>
bool serialize_single (hb_serialize_context_t *c,
hb_tag_t sfnt_tag,
Iterator items)

Some files were not shown because too many files have changed in this diff Show More