Non-spacing sentences could not be break automatically

Bug #1311698 reported by Midori
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Won't Fix
Medium
GunChleoc

Bug Description

In warehelp window, sentences have line-break correctly.
In message/story/objectives window, some disappears outside the frame.
In tool tip and loading screen, trying to display more than 20 fullwidth characters in the Japanese font, Widelands crashes or hangs.

Steps to reproduce:
1) Rewrite ./po/win_conditions/ja.po as follows, for the string:
"Each player or team tries to obtain more than half of the maps' area. The winner will be the player or the team that is able to keep that area for at least 20 minutes."
add the translation:
msgstr "各プレイヤー(チーム)は、マップ面積の半分以上を獲得しようとします。勝者は、少なくとも20分間その面積を維持したプレイヤー(チーム)です。"
2) Run ./update.sh or otherwise generate new translations (make lang).
3) Go to Options and set language to Japanese.
4) Click SinglePlayer Menu > New Game > Select a map > Type of game.
5) Mouse over on 'Territorial Lord' to show the tool chip.

Then Widelands crashes with error message:
"widelands-build18-src/src/graphic/font_handler1.cc:68] Richtext rendering error: Could not fit a single render node in line. Width of an Element is too small!中止 (コアダンプ)"

Version: build-18(Debug)
Operating system: Ubuntu13.10
Font: DejaVuSerif.ttf
Language: Japanese

Related branches

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for reporting this issue.

I added the suggested string to the ja.po translation and rebuilt them using ./update.sh. I was not able to trigger a crash though, because I only got empty squares/missing characters, even when using DejaVuSerif too.

Running in a particular language causing a crash sounds pretty bad, but I guess we should sort out the other issues too.

Changed in widelands:
importance: Undecided → Medium
tags: added: crash i18n
tags: added: internationalization
removed: i18n
Revision history for this message
Midori (midori-tj) wrote :

I'm sorry, I had a mistake.
An empty square might change a character from full-byte to single-byte.

Please remove a linebreak mark '\n' like this:
"各プレイヤー(チーム)は、マップ面積の半分以上を獲得しようとします。勝者は、少なくとも20分間その面積を維持したプレイヤー(チーム)です。"

or write more than 20x2 ASCII characters.

It is possible to avoid by increasing linebreak in the translation.
Umm ... meaningless linebreak.

I guess Chinese character in IPA font is for Japanese glyph.
I don't know much about other CJKV languages, but if they use a similar format and font, they might get a crash as well.

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Yes, with the updated string in comment #2 i get the same crash/error message in r6960. One way or another, items like tooltips probably needs an upper limit on width (to avoid endless lines, sticking out of the window/screen). So we need some way to handle this to avoid the crashes.

An easy solution is to simply insert a linebreak once the limit is reached and continue writing the rest of the characters on the next line. I'm not familiar with the language though, so I don't know this affects the meaning of what is written. This would be similar to the wrapping which happens here at Launchpad.

(Also, I took the liberty to update the report a bit).

Changed in widelands:
status: New → Confirmed
description: updated
Revision history for this message
GunChleoc (gunchleoc) wrote :

There's a thread on the 0 .D. forums concerning line breaks for Japanese text which might be relevant for this bug:

http://www.wildfiregames.com/forum/index.php?showtopic=18625

Quote:

You can break line after characters below:

, ) ] } 、 〕 〉 》 」 』 】 〙 〗 〟 ’ ” ⦆ » ‐ ゠ – 〜 ? ! ‼ ⁇ ⁈ ⁉ ・ : ; 。 .

Don't foget last one, U+3000 ideographic space.

and you can break line before characters below:

( [ { 〔 〈 《 「 『 【 〘 〖 〝 ‘ “ ⦅ «

If you are intersted in formatting Japanese text, the following might be useful.

http://www.w3.org/TR/jlreq/

Revision history for this message
SirVer (sirver) wrote :

Setting to incomplete for bug sweeping.

Changed in widelands:
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for widelands because there has been no activity for 60 days.]

Changed in widelands:
status: Incomplete → Expired
SirVer (sirver)
Changed in widelands:
status: Expired → Confirmed
GunChleoc (gunchleoc)
Changed in widelands:
status: Confirmed → In Progress
assignee: nobody → GunChleoc (gunchleoc)
milestone: none → build19-rc1
Revision history for this message
GunChleoc (gunchleoc) wrote :

The tooltips are fixed now - chat still needs some work.

GunChleoc (gunchleoc)
Changed in widelands:
status: In Progress → Triaged
milestone: build19-rc1 → none
GunChleoc (gunchleoc)
Changed in widelands:
milestone: none → build20-rc1
GunChleoc (gunchleoc)
Changed in widelands:
milestone: build20-rc1 → build21-rc1
Revision history for this message
GunChleoc (gunchleoc) wrote :
Changed in widelands:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.