Search Unity

Automated line breaking for certain languages

Discussion in 'UGUI & TextMesh Pro' started by overweightcat, Jul 12, 2022.

  1. overweightcat

    overweightcat

    Joined:
    Aug 23, 2013
    Posts:
    12
    Hi there,
    I've been wondering if there's a way to apply an automated line breaking while typing for some specific languages like Japanese & Chinese ?

    Looking forward for some clarity for those who know to solve this issues I had.
     
    Last edited: Jul 12, 2022
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Can you provide more insight on this? For instance, line breaks are usually added by hitting Enter / Return which inserts a line feed (LF) in the text or using Shift Enter which inserts a vertical tab (VT).

    Are you thinking of some other control characters? Can you provide an example?

    Are you using TMP which does have support for proper line breaking for CJK unlike the legacy text system?
     
  3. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    300
    I don't know about Chinese and Japanese. I never had to support it.

    I have been using a manual solution for Thai language. I use this library thai-wordcut - npm (npmjs.com), passing the string to it and adding empty space between word so TMP word-wrapped the string correctly.