[ot-font] Remove level of indirection in get_glyph_variant
This commit is contained in:
parent
49fe6ecf19
commit
5473ebfb84
@ -388,7 +388,7 @@ struct CmapSubtableFormat14
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
USHORT format; /* Format number is set to 0. */
|
USHORT format; /* Format number is set to 14. */
|
||||||
ULONG lengthZ; /* Byte length of this subtable. */
|
ULONG lengthZ; /* Byte length of this subtable. */
|
||||||
SortedArrayOf<VariationSelectorRecord, ULONG>
|
SortedArrayOf<VariationSelectorRecord, ULONG>
|
||||||
record; /* Variation selector records; sorted
|
record; /* Variation selector records; sorted
|
||||||
@ -416,16 +416,6 @@ struct CmapSubtable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline glyph_variant_t get_glyph_variant (hb_codepoint_t codepoint,
|
|
||||||
hb_codepoint_t variation_selector,
|
|
||||||
hb_codepoint_t *glyph) const
|
|
||||||
{
|
|
||||||
switch (u.format) {
|
|
||||||
case 14: return u.format14.get_glyph_variant(codepoint, variation_selector, glyph);
|
|
||||||
default: return GLYPH_VARIANT_NOT_FOUND;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool sanitize (hb_sanitize_context_t *c) const
|
inline bool sanitize (hb_sanitize_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_SANITIZE (this);
|
TRACE_SANITIZE (this);
|
||||||
@ -442,7 +432,7 @@ struct CmapSubtable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
union {
|
union {
|
||||||
USHORT format; /* Format identifier */
|
USHORT format; /* Format identifier */
|
||||||
CmapSubtableFormat0 format0;
|
CmapSubtableFormat0 format0;
|
||||||
|
@ -204,7 +204,7 @@ struct hb_ot_face_glyf_accelerator_t
|
|||||||
struct hb_ot_face_cmap_accelerator_t
|
struct hb_ot_face_cmap_accelerator_t
|
||||||
{
|
{
|
||||||
const OT::CmapSubtable *table;
|
const OT::CmapSubtable *table;
|
||||||
const OT::CmapSubtable *uvs_table;
|
const OT::CmapSubtableFormat14 *uvs_table;
|
||||||
hb_blob_t *blob;
|
hb_blob_t *blob;
|
||||||
|
|
||||||
inline void init (hb_face_t *face)
|
inline void init (hb_face_t *face)
|
||||||
@ -212,7 +212,7 @@ struct hb_ot_face_cmap_accelerator_t
|
|||||||
this->blob = OT::Sanitizer<OT::cmap>::sanitize (face->reference_table (HB_OT_TAG_cmap));
|
this->blob = OT::Sanitizer<OT::cmap>::sanitize (face->reference_table (HB_OT_TAG_cmap));
|
||||||
const OT::cmap *cmap = OT::Sanitizer<OT::cmap>::lock_instance (this->blob);
|
const OT::cmap *cmap = OT::Sanitizer<OT::cmap>::lock_instance (this->blob);
|
||||||
const OT::CmapSubtable *subtable = NULL;
|
const OT::CmapSubtable *subtable = NULL;
|
||||||
const OT::CmapSubtable *subtable_uvs = NULL;
|
const OT::CmapSubtableFormat14 *subtable_uvs = NULL;
|
||||||
|
|
||||||
/* 32-bit subtables. */
|
/* 32-bit subtables. */
|
||||||
if (!subtable) subtable = cmap->find_subtable (3, 10);
|
if (!subtable) subtable = cmap->find_subtable (3, 10);
|
||||||
@ -229,9 +229,14 @@ struct hb_ot_face_cmap_accelerator_t
|
|||||||
if (!subtable) subtable = &OT::Null(OT::CmapSubtable);
|
if (!subtable) subtable = &OT::Null(OT::CmapSubtable);
|
||||||
|
|
||||||
/* UVS subtable. */
|
/* UVS subtable. */
|
||||||
if (!subtable_uvs) subtable_uvs = cmap->find_subtable (0, 5);
|
if (!subtable_uvs)
|
||||||
|
{
|
||||||
|
const OT::CmapSubtable *st = cmap->find_subtable (0, 5);
|
||||||
|
if (st && st->u.format == 14)
|
||||||
|
subtable_uvs = &st->u.format14;
|
||||||
|
}
|
||||||
/* Meh. */
|
/* Meh. */
|
||||||
if (!subtable_uvs) subtable_uvs = &OT::Null(OT::CmapSubtable);
|
if (!subtable_uvs) subtable_uvs = &OT::Null(OT::CmapSubtableFormat14);
|
||||||
|
|
||||||
this->table = subtable;
|
this->table = subtable;
|
||||||
this->uvs_table = subtable_uvs;
|
this->uvs_table = subtable_uvs;
|
||||||
|
Loading…
Reference in New Issue
Block a user