[kern] Remove accelerator

It wasn't doing anything.
pull/1351/head
Behdad Esfahbod 6 years ago
parent 0382b7184a
commit 949dad89a8
  1. 2
      src/hb-ot-face.hh
  2. 55
      src/hb-ot-kern-table.hh
  3. 4
      src/hb-ot-layout.cc

@ -67,7 +67,7 @@
HB_OT_ACCELERATOR(OT, hmtx) \
HB_OT_ACCELERATOR(OT, vmtx) \
HB_OT_ACCELERATOR(OT, post) \
HB_OT_ACCELERATOR(OT, kern) \
HB_OT_TABLE(OT, kern) \
HB_OT_ACCELERATOR(OT, glyf) \
HB_OT_TABLE(OT, VORG) \
HB_OT_ACCELERATOR(OT, name) \

@ -503,49 +503,26 @@ struct kern
}
}
struct accelerator_t
{
inline void init (hb_face_t *face)
{
blob = hb_sanitize_context_t().reference_table<kern> (face);
table = blob->as<kern> ();
}
inline void fini (void)
{
hb_blob_destroy (blob);
}
inline bool has_data (void) const
{ return table->has_data (); }
inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const
{ return table->get_h_kerning (left, right); }
inline int get_kerning (hb_codepoint_t first, hb_codepoint_t second) const
{ return get_h_kerning (first, second); }
inline int get_kerning (hb_codepoint_t first, hb_codepoint_t second) const
{ return get_h_kerning (first, second); }
inline void apply (hb_font_t *font,
hb_buffer_t *buffer,
hb_mask_t kern_mask) const
{
/* We only apply horizontal kerning in this table. */
if (!HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction))
return;
hb_kern_machine_t<accelerator_t> machine (*this);
inline void apply (hb_font_t *font,
hb_buffer_t *buffer,
hb_mask_t kern_mask) const
{
/* We only apply horizontal kerning in this table. */
if (!HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction))
return;
if (!buffer->message (font, "start kern table"))
return;
hb_kern_machine_t<kern> machine (*this);
machine.kern (font, buffer, kern_mask);
if (!buffer->message (font, "start kern table"))
return;
(void) buffer->message (font, "end kern table");
}
machine.kern (font, buffer, kern_mask);
private:
hb_blob_t *blob;
const kern *table;
};
(void) buffer->message (font, "end kern table");
}
protected:
union {
@ -558,8 +535,6 @@ struct kern
DEFINE_SIZE_UNION (4, version32);
};
struct kern_accelerator_t : kern::accelerator_t {};
} /* namespace OT */

@ -55,9 +55,9 @@
**/
static const OT::kern::accelerator_t& _get_kern (hb_face_t *face)
static const OT::kern& _get_kern (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::kern::accelerator_t);
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::kern);
return *hb_ot_face_data (face)->kern;
}
const OT::GDEF& _get_gdef (hb_face_t *face)

Loading…
Cancel
Save