|
|
|
@ -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 */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|