29 #ifndef HB_OT_LAYOUT_GDEF_TABLE_HH
30 #define HB_OT_LAYOUT_GDEF_TABLE_HH
50 auto *
out =
c->serializer->start_embed (*
this);
61 unsigned int *point_count ,
62 unsigned int *point_array )
const
77 | hb_sink (
hb_array (point_array, *point_count))
87 const hb_set_t &glyphset = *
c->plan->glyphset_gsub ();
88 const hb_map_t &glyph_map = *
c->plan->glyph_map;
90 auto *
out =
c->serializer->start_embed (*
this);
95 | hb_filter (glyphset, hb_first)
96 | hb_filter (subset_offset_array (
c,
out->attachPoint,
this), hb_second)
99 | hb_sink (new_coverage)
101 out->coverage.serialize_serialize (
c->serializer, new_coverage.
iter ());
132 auto *
out =
c->serializer->embed (
this);
162 auto *
out =
c->serializer->embed (
this);
203 auto *
out =
c->serializer->embed (
this);
239 case 2:
return u.format2.get_caret_value (
font,
direction, glyph_id);
240 case 3:
return u.format3.get_caret_value (
font,
direction, var_store);
245 template <
typename context_t,
typename ...Ts>
246 typename context_t::return_t
dispatch (context_t *
c, Ts&&... ds)
const
251 case 1:
return_trace (
c->dispatch (
u.format1, std::forward<Ts> (ds)...));
252 case 2:
return_trace (
c->dispatch (
u.format2, std::forward<Ts> (ds)...));
253 case 3:
return_trace (
c->dispatch (
u.format3, std::forward<Ts> (ds)...));
265 u.format3.collect_variation_indices (layout_variation_indices);
301 unsigned *caret_count ,
309 | hb_sink (
hb_array (caret_array, *caret_count))
319 auto *
out =
c->serializer->start_embed (*
this);
323 | hb_apply (subset_offset_array (
c,
out->carets,
this))
357 unsigned int *caret_count ,
360 unsigned int index = (
this+
coverage).get_coverage (glyph_id);
374 const hb_set_t &glyphset = *
c->plan->glyphset_gsub ();
375 const hb_map_t &glyph_map = *
c->plan->glyph_map;
377 auto *
out =
c->serializer->start_embed (*
this);
382 | hb_filter (glyphset, hb_first)
383 | hb_filter (subset_offset_array (
c,
out->ligGlyph,
this), hb_second)
386 | hb_sink (new_coverage)
388 out->coverage.serialize_serialize (
c->serializer, new_coverage.
iter ());
395 | hb_filter (
c->glyph_set, hb_first)
398 | hb_apply ([
c] (
const LigGlyph&
_) {
_.collect_variation_indices (
c); })
428 auto *
out =
c->serializer->start_embed (*
this);
435 auto *
o =
out->coverage.serialize_append (
c->serializer);
445 c->serializer->push ();
447 c->serializer->add_link (*
o,
c->serializer->pop_pack ());
473 case 1:
return u.format1.covers (set_index, glyph_id);
474 default:
return false;
539 unsigned int *point_count ,
540 unsigned int *point_array )
const
548 unsigned int *caret_count ,
613 hb_map_t *layout_variation_idx_map )
const
616 if (layout_variation_indices->
is_empty ())
return;
618 unsigned new_major = 0, new_minor = 0;
619 unsigned last_major = (layout_variation_indices->
get_min ()) >> 16;
620 for (
unsigned idx : layout_variation_indices->
iter ())
622 uint16_t major =
idx >> 16;
623 if (major >= (
this+
varStore).get_sub_table_count ())
break;
624 if (major != last_major)
630 unsigned new_idx = (new_major << 16) + new_minor;
631 layout_variation_idx_map->
set (
idx, new_idx);
640 auto *
out =
c->serializer->embed (*
this);
643 bool subset_glyphclassdef =
out->glyphClassDef.serialize_subset (
c,
glyphClassDef,
this,
nullptr,
false,
true);
644 bool subset_attachlist =
out->attachList.serialize_subset (
c,
attachList,
this);
645 bool subset_ligcaretlist =
out->ligCaretList.serialize_subset (
c,
ligCaretList,
this);
646 bool subset_markattachclassdef =
out->markAttachClassDef.serialize_subset (
c,
markAttachClassDef,
this,
nullptr,
false,
true);
648 bool subset_markglyphsetsdef =
true;
652 if (!subset_markglyphsetsdef &&
654 out->version.minor = 0;
657 bool subset_varstore =
true;
660 subset_varstore =
out->varStore.serialize_subset (
c,
varStore,
this);
662 out->version.minor = 2;
665 return_trace (subset_glyphclassdef || subset_attachlist ||
666 subset_ligcaretlist || subset_markattachclassdef ||
667 (
out->version.to_int () >= 0x00010002u && subset_markglyphsetsdef) ||
668 (
out->version.to_int () >= 0x00010003u && subset_varstore));
hb_array_t< T > hb_array(T *array, unsigned int length)
hb_blob_t * hb_blob_get_empty()
void hb_blob_destroy(hb_blob_t *blob)
#define TRACE_SANITIZE(this)
#define TRACE_DISPATCH(this, format)
#define return_trace(RET)
#define TRACE_SUBSET(this)
auto it hb_map(hb_second)) template< typename Type > inline hb_array_t< Type > operator()(hb_array_t< Type > array
HB_EXTERN unsigned int start_offset
@ HB_OT_LAYOUT_GLYPH_PROPS_MARK
@ HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
@ HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH
EGLOutputLayerEXT EGLint EGLAttrib value
GLint GLint GLint GLint GLint x
[0]
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
GLfixed GLfixed GLint GLint GLfixed points
GLenum GLenum GLsizei void * table
#define HB_DIRECTION_IS_HORIZONTAL(dir)
QTextStream out(stdout)
[7]
bool subset(hb_subset_context_t *c) const
bool sanitize(hb_sanitize_context_t *c) const
Array16OfOffset16To< AttachPoint > attachPoint
unsigned int get_attach_points(hb_codepoint_t glyph_id, unsigned int start_offset, unsigned int *point_count, unsigned int *point_array) const
DEFINE_SIZE_ARRAY(4, attachPoint)
Offset16To< Coverage > coverage
bool subset(hb_subset_context_t *c) const
DEFINE_SIZE_UNION(2, format)
context_t::return_t dispatch(context_t *c, Ts &&... ds) const
hb_position_t get_caret_value(hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id, const VariationStore &var_store) const
void collect_variation_indices(hb_set_t *layout_variation_indices) const
CaretValueFormat2 format2
CaretValueFormat3 format3
union OT::CaretValue::@169 u
CaretValueFormat1 format1
bool sanitize(hb_sanitize_context_t *c) const
bool sanitize(hb_sanitize_context_t *c) const
hb_blob_ptr_t< GDEF > table
accelerator_t(hb_face_t *face)
GDEF_accelerator_t(hb_face_t *face)
unsigned int get_glyph_class(hb_codepoint_t glyph) const
void remap_layout_variation_indices(const hb_set_t *layout_variation_indices, hb_map_t *layout_variation_idx_map) const
unsigned int get_size() const
Offset16To< ClassDef > glyphClassDef
bool has_mark_attachment_types() const
bool has_glyph_classes() const
bool has_var_store() const
unsigned int get_glyph_props(hb_codepoint_t glyph) const
void get_glyphs_in_class(unsigned int klass, hb_set_t *glyphs) const
void collect_variation_indices(hb_collect_variation_indices_context_t *c) const
bool mark_set_covers(unsigned int set_index, hb_codepoint_t glyph_id) const
Offset16To< MarkGlyphSets > markGlyphSetsDef
bool has_mark_sets() const
unsigned int get_mark_attachment_type(hb_codepoint_t glyph) const
bool has_lig_carets() const
bool sanitize(hb_sanitize_context_t *c) const
static constexpr hb_tag_t tableTag
const VariationStore & get_var_store() const
Offset32To< VariationStore > varStore
Offset16To< ClassDef > markAttachClassDef
Offset16To< AttachList > attachList
unsigned int get_attach_points(hb_codepoint_t glyph_id, unsigned int start_offset, unsigned int *point_count, unsigned int *point_array) const
HB_INTERNAL bool is_blocklisted(hb_blob_t *blob, hb_face_t *face) const
unsigned int get_lig_carets(hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id, unsigned int start_offset, unsigned int *caret_count, hb_position_t *caret_array) const
Offset16To< LigCaretList > ligCaretList
bool subset(hb_subset_context_t *c) const
bool has_attach_points() const
bool subset(hb_subset_context_t *c) const
Array16OfOffset16To< LigGlyph > ligGlyph
DEFINE_SIZE_ARRAY(4, ligGlyph)
Offset16To< Coverage > coverage
void collect_variation_indices(hb_collect_variation_indices_context_t *c) const
unsigned int get_lig_carets(hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id, const VariationStore &var_store, unsigned int start_offset, unsigned int *caret_count, hb_position_t *caret_array) const
bool sanitize(hb_sanitize_context_t *c) const
unsigned get_lig_carets(hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id, const VariationStore &var_store, unsigned start_offset, unsigned *caret_count, hb_position_t *caret_array) const
DEFINE_SIZE_ARRAY(2, carets)
void collect_variation_indices(hb_collect_variation_indices_context_t *c) const
bool subset(hb_subset_context_t *c) const
bool sanitize(hb_sanitize_context_t *c) const
Array16OfOffset16To< CaretValue > carets
bool sanitize(hb_sanitize_context_t *c) const
DEFINE_SIZE_UNION(2, format)
union OT::MarkGlyphSets::@170 u
bool subset(hb_subset_context_t *c) const
bool covers(unsigned int set_index, hb_codepoint_t glyph_id) const
MarkGlyphSetsFormat1 format1
bool set(K key, const V &value)
hb_codepoint_t get_min() const