提交 13686337 编写于 作者: B Behdad Esfahbod

Add new shaper method postprocess_glyphs()

Unused currently.  To be used for Syriac stretch implementation.

https://github.com/behdad/harfbuzz/issues/141
上级 6c0ebd02
...@@ -379,7 +379,8 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_arabic = ...@@ -379,7 +379,8 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_arabic =
NULL, /* override_features */ NULL, /* override_features */
data_create_arabic, data_create_arabic,
data_destroy_arabic, data_destroy_arabic,
NULL, /* preprocess_text_arabic */ NULL, /* preprocess_text */
NULL, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT, HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
NULL, /* decompose */ NULL, /* decompose */
NULL, /* compose */ NULL, /* compose */
......
...@@ -35,6 +35,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_default = ...@@ -35,6 +35,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_default =
NULL, /* data_create */ NULL, /* data_create */
NULL, /* data_destroy */ NULL, /* data_destroy */
NULL, /* preprocess_text */ NULL, /* preprocess_text */
NULL, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT, HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
NULL, /* decompose */ NULL, /* decompose */
NULL, /* compose */ NULL, /* compose */
......
...@@ -411,13 +411,14 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hangul = ...@@ -411,13 +411,14 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hangul =
"hangul", "hangul",
collect_features_hangul, collect_features_hangul,
override_features_hangul, override_features_hangul,
data_create_hangul, /* data_create */ data_create_hangul,
data_destroy_hangul, /* data_destroy */ data_destroy_hangul,
preprocess_text_hangul, preprocess_text_hangul,
NULL, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_NONE, HB_OT_SHAPE_NORMALIZATION_MODE_NONE,
NULL, /* decompose */ NULL, /* decompose */
NULL, /* compose */ NULL, /* compose */
setup_masks_hangul, /* setup_masks */ setup_masks_hangul,
HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE,
false, /* fallback_position */ false, /* fallback_position */
}; };
...@@ -163,6 +163,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hebrew = ...@@ -163,6 +163,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hebrew =
NULL, /* data_create */ NULL, /* data_create */
NULL, /* data_destroy */ NULL, /* data_destroy */
NULL, /* preprocess_text */ NULL, /* preprocess_text */
NULL, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT, HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
NULL, /* decompose */ NULL, /* decompose */
compose_hebrew, compose_hebrew,
......
...@@ -1834,6 +1834,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_indic = ...@@ -1834,6 +1834,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_indic =
data_create_indic, data_create_indic,
data_destroy_indic, data_destroy_indic,
NULL, /* preprocess_text */ NULL, /* preprocess_text */
NULL, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT, HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
decompose_indic, decompose_indic,
compose_indic, compose_indic,
......
...@@ -507,6 +507,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar_old = ...@@ -507,6 +507,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar_old =
NULL, /* data_create */ NULL, /* data_create */
NULL, /* data_destroy */ NULL, /* data_destroy */
NULL, /* preprocess_text */ NULL, /* preprocess_text */
NULL, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT, HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
NULL, /* decompose */ NULL, /* decompose */
NULL, /* compose */ NULL, /* compose */
...@@ -523,6 +524,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar = ...@@ -523,6 +524,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar =
NULL, /* data_create */ NULL, /* data_create */
NULL, /* data_destroy */ NULL, /* data_destroy */
NULL, /* preprocess_text */ NULL, /* preprocess_text */
NULL, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT, HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
NULL, /* decompose */ NULL, /* decompose */
NULL, /* compose */ NULL, /* compose */
......
...@@ -110,6 +110,15 @@ struct hb_ot_complex_shaper_t ...@@ -110,6 +110,15 @@ struct hb_ot_complex_shaper_t
hb_buffer_t *buffer, hb_buffer_t *buffer,
hb_font_t *font); hb_font_t *font);
/* postprocess_glyphs()
* Called during shape().
* Shapers can use to modify glyphs after shaping ends.
* May be NULL.
*/
void (*postprocess_glyphs) (const hb_ot_shape_plan_t *plan,
hb_buffer_t *buffer,
hb_font_t *font);
hb_ot_shape_normalization_mode_t normalization_preference; hb_ot_shape_normalization_mode_t normalization_preference;
......
...@@ -372,6 +372,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_thai = ...@@ -372,6 +372,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_thai =
NULL, /* data_create */ NULL, /* data_create */
NULL, /* data_destroy */ NULL, /* data_destroy */
preprocess_text_thai, preprocess_text_thai,
NULL, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT, HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
NULL, /* decompose */ NULL, /* decompose */
NULL, /* compose */ NULL, /* compose */
......
...@@ -52,6 +52,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_tibetan = ...@@ -52,6 +52,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_tibetan =
NULL, /* data_create */ NULL, /* data_create */
NULL, /* data_destroy */ NULL, /* data_destroy */
NULL, /* preprocess_text */ NULL, /* preprocess_text */
NULL, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT, HB_OT_SHAPE_NORMALIZATION_MODE_DEFAULT,
NULL, /* decompose */ NULL, /* decompose */
NULL, /* compose */ NULL, /* compose */
......
...@@ -576,6 +576,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use = ...@@ -576,6 +576,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use =
data_create_use, data_create_use,
data_destroy_use, data_destroy_use,
NULL, /* preprocess_text */ NULL, /* preprocess_text */
NULL, /* postprocess_glyphs */
HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT, HB_OT_SHAPE_NORMALIZATION_MODE_COMPOSED_DIACRITICS_NO_SHORT_CIRCUIT,
NULL, /* decompose */ NULL, /* decompose */
compose_use, compose_use,
......
...@@ -553,9 +553,6 @@ hb_ot_substitute_default (hb_ot_shape_context_t *c) ...@@ -553,9 +553,6 @@ hb_ot_substitute_default (hb_ot_shape_context_t *c)
{ {
hb_buffer_t *buffer = c->buffer; hb_buffer_t *buffer = c->buffer;
if (c->plan->shaper->preprocess_text)
c->plan->shaper->preprocess_text (c->plan, buffer, c->font);
hb_ot_shape_initialize_masks (c); hb_ot_shape_initialize_masks (c);
hb_ot_mirror_chars (c); hb_ot_mirror_chars (c);
...@@ -815,11 +812,17 @@ hb_ot_shape_internal (hb_ot_shape_context_t *c) ...@@ -815,11 +812,17 @@ hb_ot_shape_internal (hb_ot_shape_context_t *c)
hb_ensure_native_direction (c->buffer); hb_ensure_native_direction (c->buffer);
if (c->plan->shaper->preprocess_text)
c->plan->shaper->preprocess_text (c->plan, c->buffer, c->font);
hb_ot_substitute (c); hb_ot_substitute (c);
hb_ot_position (c); hb_ot_position (c);
hb_ot_hide_default_ignorables (c); hb_ot_hide_default_ignorables (c);
if (c->plan->shaper->postprocess_glyphs)
c->plan->shaper->postprocess_glyphs (c->plan, c->buffer, c->font);
_hb_buffer_deallocate_unicode_vars (c->buffer); _hb_buffer_deallocate_unicode_vars (c->buffer);
c->buffer->props.direction = c->target_direction; c->buffer->props.direction = c->target_direction;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册