octo8
1
I found that when typing Japanese, the tracking argument of text function does not work correctly.
Example:
The code for this export is here: japanese-spacing
What happening here is that the tracking is not working between different type of characters: Kanji, Hiragana, and Katakana.
I have two questions:
- Is it feature or bug?
- If it IS bug, is there any way to avoid this?
Andrew
2
Something strange is going on with using regex too:
#show regex("[\\p{Hiragana}\\p{Katakana}\\p{Han}]+"): it => box(stroke: 1pt, it)
あのイーハトーヴォのすきとおった風、夏でも底に冷たさをもつ青いそら、うつくしい森で飾られたモリーオ市、郊外のぎらぎらひかる草の波。

Which can explain why this doesn’t work perfectly:
#show regex("[\\p{Hiragana}\\p{Katakana}\\p{Han}]+"): it => it.text.clusters().join(h(1em))
あのイーハトーヴォのすきとおった風、夏でも底に冷たさをもつ青いそら、うつくしい森で飾られたモリーオ市、郊外のぎらぎらひかる草の波。

I thought that something like this could work:
#set text(tracking: 1em)
#show regex("\\p{Hiragana}\\p{Katakana}"): it => it.text.clusters().join(sym.zws)
#set text(tracking: 1em)
#show regex("[\\p{Hiragana}\\p{Katakana}\\p{Han}]+"): it => it.text.clusters().join(h(1em))