3

Given a text in Japanese ending in period (。) as all Japanese characters are treated as individual words the period can break alone. Is there a way to avoid this not knowing previously the word count by line?

ひらがなは文の終わりに現れることが多
く、1文字だけでなく1〜4文字のまとま
がなは表示されます。 感嘆符と疑符は
「ダブルバイト」であり、標準のなは表

Ole V.V.
  • 81,772
  • 15
  • 137
  • 161
pabben
  • 341
  • 7
  • 14
  • Does this answer your question? [In HTML and CSS, how do I make japanese text break lines correctly?](https://stackoverflow.com/questions/5249409/in-html-and-css-how-do-i-make-japanese-text-break-lines-correctly) – Matthew Mar 12 '20 at 00:32
  • Unfortunately no. – pabben Mar 12 '20 at 01:45
  • 1
    I'm curious, how did it happen? Whats the size of the container, the font setting? I was trying to replicate your problem, but couldn't. Perhaps you could show some more info? – Markipe Mar 12 '20 at 02:01
  • You can use JS to calculate the character width and measure the DIV width (see [this](https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript), in order to know whether the last Japanese period character is alone at the last line or not. – Raptor Mar 12 '20 at 02:02
  • As @Markipe mentioned the issue depends on the container size. In my case the size is fixed it only changes depending on the email client. The problem appeared in Outlook but could be on mobile for other text. Raptor9, as you can see I cannot use JS, only CSS, html, a bit of magic and good luck. I'm using this into emails and need to be compatible with different email clients. – pabben Mar 12 '20 at 13:51

0 Answers0