らんだむな記憶

blogというものを体験してみようか!的なー

ちょっとだけharfbuzz(6)

$ git diff
diff --git a/src/hb-ot-shape-complex-private.hh b/src/hb-ot-shape-complex-private.hh
index b3372bd..4d75b33 100644
--- a/src/hb-ot-shape-complex-private.hh
+++ b/src/hb-ot-shape-complex-private.hh
@@ -159,6 +159,9 @@ HB_COMPLEX_SHAPERS_IMPLEMENT_SHAPERS
 static inline const hb_ot_complex_shaper_t *
 hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner)
 {
+         const unsigned char tag[] = { HB_UNTAG(planner->props.script) };
+         printf("[%s] planner->props.script=%c%c%c%c\n", __FUNCTION__, tag[0], tag[1], tag[2], tag[3]);
+

こういうことをしてみると、

[hb_ot_shape_complex_categorize] planner->props.script=Arab

と出た。おぉっ、なんか自動でアラビア語だって判定しているな。だから、init, medi, finaが発動するのか。

hb-buffer.cc で hb_buffer_t::guess_segment_properties にて推測しているらしい。
shape_options_t::setup_buffer の中で hb_buffer_guess_segment_properties を呼び出しているので、このタイミングかな。
shape_consumer_t::consume_line -> shape_options_t::populate_buffer -> shape_options_t::setup_buffer の連鎖で繋がってきているようだ。