Works beautifully! Test coming.
inline hb_aat_apply_context_t (hb_ot_shape_plan_t *plan_,
hb_font_t *font_,
hb_buffer_t *buffer_,
- hb_blob_t *table,
+ hb_blob_t *blob = const_cast<hb_blob_t *> (&Null(hb_blob_t)),
const ankr &ankr_table_ = Null(ankr),
const char *ankr_end_ = nullptr) :
plan (plan_), font (font_), face (font->face), buffer (buffer_),
ankr_table (ankr_table_), ankr_end (ankr_end_),
lookup_index (0), debug_depth (0)
{
- sanitizer.init (table);
+ sanitizer.init (blob);
sanitizer.set_num_glyphs (face->get_num_glyphs ());
sanitizer.start_processing ();
sanitizer.set_max_ops (HB_SANITIZE_MAX_OPS_MAX);
/* TODO bfind() */
unsigned int size_index;
- UnsizedArrayOf<Fixed> size_table = base+sizeTable;
+ hb_array_t<Fixed> size_table ((base+sizeTable).arrayZ, sizes);
for (size_index = 0; size_index < sizes; size_index++)
- if (size_table[size_index] >= fixed_size)
+ if ((int) size_table[size_index] >= (int) fixed_size)
break;
// TODO(ebraminio): We don't attempt to extrapolate to larger or
{
static const hb_tag_t tableTag = HB_AAT_TAG_trak;
+ inline bool has_data (void) const { return version.to_int () != 0; }
+
inline bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
#include "hb-aat-ltag-table.hh" // Just so we compile it; unused otherwise.
/*
- * morx/kerx/trak/ankr
+ * morx/kerx/trak
*/
static inline const AAT::morx&
*blob = hb_ot_face_data (face)->ankr.get_blob ();
return ankr;
}
+static inline const AAT::trak&
+_get_trak (hb_face_t *face)
+{
+ if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(AAT::trak);
+ return *(hb_ot_face_data (face)->trak.get ());
+}
hb_bool_t
ankr, ankr_blob->data + ankr_blob->length);
kerx.apply (&c);
}
+
+hb_bool_t
+hb_aat_layout_has_tracking (hb_face_t *face)
+{
+ return _get_trak (face).has_data ();
+}
+
+void
+hb_aat_layout_track (hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer)
+{
+ const AAT::trak& trak = _get_trak (font->face);
+
+ AAT::hb_aat_apply_context_t c (plan, font, buffer);
+ trak.apply (&c);
+}
hb_font_t *font,
hb_buffer_t *buffer);
+HB_INTERNAL hb_bool_t
+hb_aat_layout_has_tracking (hb_face_t *face);
+
+HB_INTERNAL void
+hb_aat_layout_track (hb_ot_shape_plan_t *plan,
+ hb_font_t *font,
+ hb_buffer_t *buffer);
+
#endif /* HB_AAT_LAYOUT_HH */
else if (c->plan->apply_kerx)
hb_aat_layout_position (c->plan, c->font, c->buffer);
+ hb_aat_layout_track (c->plan, c->font, c->buffer);
+
if (!c->plan->apply_kerx)
switch (c->plan->shaper->zero_width_marks)
{