[name] Hide internal details from public API
This commit is contained in:
parent
e7c595a9f0
commit
a826a8730f
@ -33,6 +33,10 @@
|
|||||||
namespace OT {
|
namespace OT {
|
||||||
|
|
||||||
|
|
||||||
|
#define entry_score var.u16[0]
|
||||||
|
#define entry_index var.u16[1]
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* name -- Naming
|
* name -- Naming
|
||||||
* https://docs.microsoft.com/en-us/typography/opentype/spec/name
|
* https://docs.microsoft.com/en-us/typography/opentype/spec/name
|
||||||
@ -118,11 +122,11 @@ _hb_ot_name_entry_cmp (const void *pa, const void *pb)
|
|||||||
if (e)
|
if (e)
|
||||||
return e;
|
return e;
|
||||||
|
|
||||||
if (a->score != b->score)
|
if (a->entry_score != b->entry_score)
|
||||||
return a->score < b->score ? -1 : +1;
|
return a->entry_score < b->entry_score ? -1 : +1;
|
||||||
|
|
||||||
if (a->index != b->index)
|
if (a->entry_index != b->entry_index)
|
||||||
return a->index < b->index ? -1 : +1;
|
return a->entry_index < b->entry_index ? -1 : +1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -174,13 +178,12 @@ struct name
|
|||||||
|
|
||||||
for (uint16_t i = 0; i < all_names.len; i++)
|
for (uint16_t i = 0; i < all_names.len; i++)
|
||||||
{
|
{
|
||||||
unsigned int name_id = all_names[i].nameID;
|
hb_ot_name_entry_t *entry = this->names.push ();
|
||||||
uint16_t score = all_names[i].score ();
|
|
||||||
hb_language_t language = HB_LANGUAGE_INVALID; /* XXX */
|
|
||||||
|
|
||||||
hb_ot_name_entry_t entry = {name_id, score, i, language};
|
entry->name_id = all_names[i].nameID;
|
||||||
|
entry->language = HB_LANGUAGE_INVALID; /* XXX */
|
||||||
this->names.push (entry);
|
entry->entry_score = all_names[i].score ();
|
||||||
|
entry->entry_index = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->names.qsort (_hb_ot_name_entry_cmp);
|
this->names.qsort (_hb_ot_name_entry_cmp);
|
||||||
|
@ -79,8 +79,7 @@ typedef struct hb_ot_name_entry_t
|
|||||||
{
|
{
|
||||||
hb_name_id_t name_id;
|
hb_name_id_t name_id;
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
uint16_t score;
|
hb_var_int_t var;
|
||||||
uint16_t index;
|
|
||||||
/*< public >*/
|
/*< public >*/
|
||||||
hb_language_t language;
|
hb_language_t language;
|
||||||
} hb_ot_name_entry_t;
|
} hb_ot_name_entry_t;
|
||||||
|
Loading…
Reference in New Issue
Block a user