[kern] Add kerning driver to TT kern table
This commit is contained in:
parent
683c3a9533
commit
3c23ff9b7c
@ -35,7 +35,7 @@
|
||||
template <typename Driver>
|
||||
struct hb_kern_machine_t
|
||||
{
|
||||
hb_kern_machine_t (Driver &driver_) : driver (driver_) {}
|
||||
hb_kern_machine_t (const Driver &driver_) : driver (driver_) {}
|
||||
|
||||
inline void kern (const hb_ot_shape_plan_t *plan,
|
||||
hb_font_t *font,
|
||||
@ -96,7 +96,7 @@ struct hb_kern_machine_t
|
||||
}
|
||||
}
|
||||
|
||||
Driver &driver;
|
||||
const Driver &driver;
|
||||
};
|
||||
|
||||
|
||||
@ -447,6 +447,21 @@ struct kern
|
||||
inline int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const
|
||||
{ return table->get_h_kerning (left, right, table_length); }
|
||||
|
||||
inline int get_kerning (hb_codepoint_t first, hb_codepoint_t second) const
|
||||
{ return get_h_kerning (first, second); }
|
||||
|
||||
inline void apply (hb_ot_shape_plan_t *plan,
|
||||
hb_font_t *font,
|
||||
hb_buffer_t *buffer) const
|
||||
{
|
||||
if (!HB_DIRECTION_IS_HORIZONTAL (buffer->props.direction))
|
||||
return;
|
||||
|
||||
hb_kern_machine_t<accelerator_t> machine (*this);
|
||||
|
||||
machine.kern (plan, font, buffer);
|
||||
}
|
||||
|
||||
private:
|
||||
hb_blob_t *blob;
|
||||
const kern *table;
|
||||
|
@ -447,7 +447,7 @@ _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan,
|
||||
hb_buffer_t *buffer) :
|
||||
font (font_), direction (buffer->props.direction) {}
|
||||
|
||||
hb_position_t get_kerning (hb_codepoint_t first, hb_codepoint_t second)
|
||||
hb_position_t get_kerning (hb_codepoint_t first, hb_codepoint_t second) const
|
||||
{
|
||||
hb_position_t kern = 0;
|
||||
font->get_glyph_kerning_for_direction (first, second,
|
||||
|
Loading…
Reference in New Issue
Block a user