parent
0382b7184a
commit
949dad89a8
|
@ -67,7 +67,7 @@
|
||||||
HB_OT_ACCELERATOR(OT, hmtx) \
|
HB_OT_ACCELERATOR(OT, hmtx) \
|
||||||
HB_OT_ACCELERATOR(OT, vmtx) \
|
HB_OT_ACCELERATOR(OT, vmtx) \
|
||||||
HB_OT_ACCELERATOR(OT, post) \
|
HB_OT_ACCELERATOR(OT, post) \
|
||||||
HB_OT_ACCELERATOR(OT, kern) \
|
HB_OT_TABLE(OT, kern) \
|
||||||
HB_OT_ACCELERATOR(OT, glyf) \
|
HB_OT_ACCELERATOR(OT, glyf) \
|
||||||
HB_OT_TABLE(OT, VORG) \
|
HB_OT_TABLE(OT, VORG) \
|
||||||
HB_OT_ACCELERATOR(OT, name) \
|
HB_OT_ACCELERATOR(OT, name) \
|
||||||
|
|
|
@ -503,49 +503,26 @@ struct kern
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct accelerator_t
|
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
|
||||||
{
|
{
|
||||||
inline void init (hb_face_t *face)
|
/* We only apply horizontal kerning in this table. */
|
||||||
{
|
if (!HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction))
|
||||||
blob = hb_sanitize_context_t().reference_table<kern> (face);
|
return;
|
||||||
table = blob->as<kern> ();
|
|
||||||
}
|
|
||||||
inline void fini (void)
|
|
||||||
{
|
|
||||||
hb_blob_destroy (blob);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool has_data (void) const
|
hb_kern_machine_t<kern> machine (*this);
|
||||||
{ return table->has_data (); }
|
|
||||||
|
|
||||||
inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const
|
if (!buffer->message (font, "start kern table"))
|
||||||
{ return table->get_h_kerning (left, right); }
|
return;
|
||||||
|
|
||||||
inline int get_kerning (hb_codepoint_t first, hb_codepoint_t second) const
|
machine.kern (font, buffer, kern_mask);
|
||||||
{ return get_h_kerning (first, second); }
|
|
||||||
|
|
||||||
inline void apply (hb_font_t *font,
|
(void) buffer->message (font, "end kern table");
|
||||||
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);
|
|
||||||
|
|
||||||
if (!buffer->message (font, "start kern table"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
machine.kern (font, buffer, kern_mask);
|
|
||||||
|
|
||||||
(void) buffer->message (font, "end kern table");
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
hb_blob_t *blob;
|
|
||||||
const kern *table;
|
|
||||||
};
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
union {
|
union {
|
||||||
|
@ -558,8 +535,6 @@ struct kern
|
||||||
DEFINE_SIZE_UNION (4, version32);
|
DEFINE_SIZE_UNION (4, version32);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct kern_accelerator_t : kern::accelerator_t {};
|
|
||||||
|
|
||||||
} /* namespace OT */
|
} /* 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;
|
return *hb_ot_face_data (face)->kern;
|
||||||
}
|
}
|
||||||
const OT::GDEF& _get_gdef (hb_face_t *face)
|
const OT::GDEF& _get_gdef (hb_face_t *face)
|
||||||
|
|
Loading…
Reference in New Issue