parent
f7515769fd
commit
f9abbf83b6
|
@ -78,7 +78,26 @@ struct hb_ot_map_t
|
||||||
pause_func_t pause_func;
|
pause_func_t pause_func;
|
||||||
};
|
};
|
||||||
|
|
||||||
hb_ot_map_t (void) { memset (this, 0, sizeof (*this)); }
|
inline void init (void)
|
||||||
|
{
|
||||||
|
memset (this, 0, sizeof (*this));
|
||||||
|
|
||||||
|
features.init ();
|
||||||
|
for (unsigned int table_index = 0; table_index < 2; table_index++)
|
||||||
|
{
|
||||||
|
lookups[table_index].init ();
|
||||||
|
stages[table_index].init ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
inline void fini (void)
|
||||||
|
{
|
||||||
|
features.fini ();
|
||||||
|
for (unsigned int table_index = 0; table_index < 2; table_index++)
|
||||||
|
{
|
||||||
|
lookups[table_index].fini ();
|
||||||
|
stages[table_index].fini ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
inline hb_mask_t get_global_mask (void) const { return global_mask; }
|
inline hb_mask_t get_global_mask (void) const { return global_mask; }
|
||||||
|
|
||||||
|
@ -129,15 +148,6 @@ struct hb_ot_map_t
|
||||||
HB_INTERNAL void substitute (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const;
|
HB_INTERNAL void substitute (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const;
|
||||||
HB_INTERNAL void position (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const;
|
HB_INTERNAL void position (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const;
|
||||||
|
|
||||||
inline void fini (void) {
|
|
||||||
features.fini ();
|
|
||||||
for (unsigned int table_index = 0; table_index < 2; table_index++)
|
|
||||||
{
|
|
||||||
lookups[table_index].fini ();
|
|
||||||
stages[table_index].fini ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
hb_tag_t chosen_script[2];
|
hb_tag_t chosen_script[2];
|
||||||
bool found_script[2];
|
bool found_script[2];
|
||||||
|
@ -171,6 +181,8 @@ struct hb_ot_map_builder_t
|
||||||
HB_INTERNAL hb_ot_map_builder_t (hb_face_t *face_,
|
HB_INTERNAL hb_ot_map_builder_t (hb_face_t *face_,
|
||||||
const hb_segment_properties_t *props_);
|
const hb_segment_properties_t *props_);
|
||||||
|
|
||||||
|
HB_INTERNAL ~hb_ot_map_builder_t (void);
|
||||||
|
|
||||||
HB_INTERNAL void add_feature (hb_tag_t tag, unsigned int value,
|
HB_INTERNAL void add_feature (hb_tag_t tag, unsigned int value,
|
||||||
hb_ot_map_feature_flags_t flags);
|
hb_ot_map_feature_flags_t flags);
|
||||||
|
|
||||||
|
@ -186,14 +198,6 @@ struct hb_ot_map_builder_t
|
||||||
const int *coords,
|
const int *coords,
|
||||||
unsigned int num_coords);
|
unsigned int num_coords);
|
||||||
|
|
||||||
inline void fini (void) {
|
|
||||||
feature_infos.fini ();
|
|
||||||
for (unsigned int table_index = 0; table_index < 2; table_index++)
|
|
||||||
{
|
|
||||||
stages[table_index].fini ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
HB_INTERNAL void add_lookups (hb_ot_map_t &m,
|
HB_INTERNAL void add_lookups (hb_ot_map_t &m,
|
||||||
|
|
|
@ -43,6 +43,10 @@ hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_,
|
||||||
{
|
{
|
||||||
memset (this, 0, sizeof (*this));
|
memset (this, 0, sizeof (*this));
|
||||||
|
|
||||||
|
feature_infos.init ();
|
||||||
|
for (unsigned int table_index = 0; table_index < 2; table_index++)
|
||||||
|
stages[table_index].init ();
|
||||||
|
|
||||||
face = face_;
|
face = face_;
|
||||||
props = *props_;
|
props = *props_;
|
||||||
|
|
||||||
|
@ -63,6 +67,13 @@ hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hb_ot_map_builder_t::~hb_ot_map_builder_t (void)
|
||||||
|
{
|
||||||
|
feature_infos.fini ();
|
||||||
|
for (unsigned int table_index = 0; table_index < 2; table_index++)
|
||||||
|
stages[table_index].fini ();
|
||||||
|
}
|
||||||
|
|
||||||
void hb_ot_map_builder_t::add_feature (hb_tag_t tag, unsigned int value,
|
void hb_ot_map_builder_t::add_feature (hb_tag_t tag, unsigned int value,
|
||||||
hb_ot_map_feature_flags_t flags)
|
hb_ot_map_feature_flags_t flags)
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,12 +109,13 @@ struct post
|
||||||
{
|
{
|
||||||
inline void init (hb_face_t *face)
|
inline void init (hb_face_t *face)
|
||||||
{
|
{
|
||||||
|
index_to_offset.init ();
|
||||||
|
|
||||||
blob = Sanitizer<post>().sanitize (face->reference_table (HB_OT_TAG_post));
|
blob = Sanitizer<post>().sanitize (face->reference_table (HB_OT_TAG_post));
|
||||||
const post *table = blob->as<post> ();
|
const post *table = blob->as<post> ();
|
||||||
unsigned int table_length = blob->length;
|
unsigned int table_length = blob->length;
|
||||||
|
|
||||||
version = table->version.to_int ();
|
version = table->version.to_int ();
|
||||||
index_to_offset.init ();
|
|
||||||
if (version != 0x00020000)
|
if (version != 0x00020000)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,14 @@ struct hb_ot_shape_plan_t
|
||||||
inline void substitute (hb_font_t *font, hb_buffer_t *buffer) const { map.substitute (this, font, buffer); }
|
inline void substitute (hb_font_t *font, hb_buffer_t *buffer) const { map.substitute (this, font, buffer); }
|
||||||
inline void position (hb_font_t *font, hb_buffer_t *buffer) const { map.position (this, font, buffer); }
|
inline void position (hb_font_t *font, hb_buffer_t *buffer) const { map.position (this, font, buffer); }
|
||||||
|
|
||||||
void fini (void) { map.fini (); }
|
void init (void)
|
||||||
|
{
|
||||||
|
memset (this, 0, sizeof (*this));
|
||||||
|
map.init ();
|
||||||
|
}
|
||||||
|
void fini (void) {
|
||||||
|
map.fini ();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hb_ot_shape_planner_t
|
struct hb_ot_shape_planner_t
|
||||||
|
@ -75,7 +82,6 @@ struct hb_ot_shape_planner_t
|
||||||
props (master_plan->props),
|
props (master_plan->props),
|
||||||
shaper (nullptr),
|
shaper (nullptr),
|
||||||
map (face, &props) {}
|
map (face, &props) {}
|
||||||
~hb_ot_shape_planner_t (void) { map.fini (); }
|
|
||||||
|
|
||||||
inline void compile (hb_ot_shape_plan_t &plan,
|
inline void compile (hb_ot_shape_plan_t &plan,
|
||||||
const int *coords,
|
const int *coords,
|
||||||
|
|
|
@ -180,6 +180,8 @@ _hb_ot_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan,
|
||||||
if (unlikely (!plan))
|
if (unlikely (!plan))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
plan->init ();
|
||||||
|
|
||||||
hb_ot_shape_planner_t planner (shape_plan);
|
hb_ot_shape_planner_t planner (shape_plan);
|
||||||
|
|
||||||
planner.shaper = hb_ot_shape_complex_categorize (&planner);
|
planner.shaper = hb_ot_shape_complex_categorize (&planner);
|
||||||
|
|
|
@ -133,6 +133,8 @@ _hb_subset_face_data_create (void)
|
||||||
if (unlikely (!data))
|
if (unlikely (!data))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
data->tables.init ();
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue