(Migrated from #discussions)
I need glues to control inter-character horizontal spacing, like how cjkglue and cjkecglue work in xeCJK. I am informed that Typst core runtime does not expose a glue API. I wonder if I can write a preprocessor function that inserts #h(...) at each inter-character boundary, (recursively) iterating over content token-chain ([abc] being interpreted as a token-chain array([a],[b],[c]), for example). So my function returns a content block [a#h(...)b#h(...)c] (without impairing Knuth-Plass line breaking). It is like how Array.reduce works in JS. The parameters to each #h() is individually decided by consulting the type (western char / CJK char / inline block / etc) of the left token and the right token. An inline block is atomic and shall be treated as single token among plain characters.
Specifically, the major challenge here is whether a way to do the iteration is available. I did not find any specific mention on token-chain iteration or methods of content blocks in the documentation. Do enlighten me if some information is already documented.