Text wrapping and line breaking

Some languages require more complex handling of word wrapping and line breaking. Languages based on the Latin script are fairly simple to handle, as words are separated by a space, and you can break a line at a space, tab, or hyphen. However, in languages such as Thai and Khmer, words run together with no space in between.

Languages can have their own rules for line breaking and word wrapping. Symbian uses the defined legal combinations of characters to apply line breaking.

Wordjoiner (WORDJOINER: U+2060)

Wordjoiner is a character that is used to manually override word breaks. The wordjoiner has no width so it is not visible in the UI. The function of the character is to indicate that line breaks are not allowed between the adjoining characters.

In other words, wordjoiner prevents a break at a position. In Thai language, it has been used as a quick fix to correct line wrapping in the rare occasions where the zero-width space character does not work.

Word Joiner (WJ) can be used to glue characters together.

When using QML, the "wrap mode" property affects how the wrapping is performed. "Word wrap" and "No wrap" are the wrap modes which respect the WJ. Other wrap modes override the WJ. "Word wrap" can be used with all languages. See the enumeration wrapMode.

There are currently differences between languages how the wrapping is performed. For example, wrapping with WJ works differently for Thai than for Chinese. In Thai the Zero-width space (ZWS) is used to separate words. With Chinese, ZWS has no real use. Chinese can use WJ if needed to glue glyphs together. Wrapping of "dot" character (U+3302 in Unicode) is handled automatically in QML, no WJ is needed.

Word Joiner example — Case 1: Thai

Logical name: qtn_err_wlan_sc_config_failed_try_again/errorres

English: WLAN configuration failed. Try again.

Thai translation: การ\u200Bกำหนด\u200Bค่า WLAN ล้มเหลว ลอง\u200Bอีก\u200Bครั้ง

Notice that in the Thai translation the zero width space character (\u200B) has been used to indicate the correct place for a word break. However, since the translation contains Latin characters, the zero-width space does not function. The text is still incorrectly wrapped in the UI, so wordjoiner is used to correctly wrap the translation.

การกำหนดค่า WLAN ล้มเหลว ลองอีกครั้ง

If we want "ล้มเ" to be in same line we have to add wordjoiner between ล้ and and also between and , just to make sure that the whole word sticks together.

So result would be (□ represents wordjoiner):

การกำหนดค่า WLAN

ล้□ม□เหลว ลองอีกครั้ง

Zero-width space (ZWSP : U+200B)

Zero-width space indicates a word boundary and just as wordjoiner, it has no width and is thus not visible in the UI. It is used in languages such as Thai that have no visible word spacing to represent word breaks.

Note: The zero-width space does not work if the text contains Latin characters. This applies to Thai language. In these occasions, please use also wordjoiner to correct the text.

Forced line feed (Forced line feed: \n)

Forced line feed character has been used in Symbian localization in the past as an easy fix for incorrectly wrapped texts. However, its use is not recommended.

Forced line feed is problematic, since it overrides the line wrapper and forces the line to break at a certain point. Since we support two display resolutions, QVGA and QHD, forced line feed causes problems. The text might be correctly wrapped in QVGA but not in QHD resolutions after adding a forced line feed, and that would generate unnecessary errors.

Forced line feed example — Case 2: Japanese

Logical name: qtn_smsvo_invalid_number/vmbx

English: Invalid call mailbox number

Japanese translation: 留守番電話セン\nターの番号が正しくありません

The text is incorrectly wrapped since "ー" is not allowed at the beginning of the line in Japanese and to avoid the situation, the forced line feed character (\n) has been inserted before ”タ" to correct the situation. However, since the translations should support both QVGA and QHD displays, the solution is not sufficient.

The text is correctly wrapped in QVGA but not in QHD where there is an unnecessary empty space. The forced line feed character has to be removed and replaced with the wordjoiner character since the wordjoiner character can be used whether the device is in whichever mode.

留守番電話セン\nターの番号が正しくありません

The forced line feed character, \n, has to be removed before "ター" and the wordjoiner character added between “タ” and “ー". After the wordjoiner has been added, the characters before and after it stick together.

So result would be (□ represents wordjoiner):

留守番電話センタ□ーの

番号が正しくありませ

Forced line feed example — Case 3: Chinese

Logical name: qtn_bt_block_all_conn_attempts/btnotif

English: Block all future connection requests from %U?

Chinese translation: 禁止%U以后发来的所有连接\n请求?

Again, the text is incorrectly wrapped and the forced line feed character (\n) has been inserted to correct the situation. It has not helped, so it has to be removed and the wordjoiner inserted to wrap the text correctly.

禁止%U以后发来的所有连接\n请求?

So the forced line feed character, \n, is removed before "请" and the wordjoiner character added between “求” and “?" to prevent the question mark from appearing alone at the beginning of a line.

So result would be (□ represents wordjoiner):

禁止%U以后发来的所有

连接请求⁠?

Using unicode characters for text wrapping

Problem with Thai, Japanese and Chinese is that usually there are no spaces in translations and thus linewrapper doesn't know from where to break the text to the next line. Usually it breaks only in case of space or other wrapping point.

In Symbian localization for Thai, the text wrapping has been corrected by adding zero width space characters to appropriate places to ensure that the text is correctly wrapped and breaks only at the specified places. For Japanese and Chinese, the use of the zero width space is not recommended.

Note: If you see one of these special characters in the text mass, please do not remove them.