Thai line breaking: how to break Thai text effectively

后端 未结 2 549
时光取名叫无心
时光取名叫无心 2021-02-02 09:04

Situation with Thai text on a client site is that we can\'t control where exactly particular words/sentences are going to break between the lines (how web b

2条回答
  •  一整个雨季
    2021-02-02 09:34

    The ICU and ICU4J libraries have a dictionary based word break iterator for Thai that you could use on the server side to inject breaking zero width spaces where appropriate.

    Or, you could use this to build a utility that could run at build time or on delivery of translations, if you knew the spacing requirements that far in advance.

    see ICU Boundary Analysis for more info. These libraries are available for C, C++, and Java.

提交回复
热议问题