Forum How do I...?

prince-wrap-inside and prince-forced-breaks do not work

Shyujikou
Hi, I'm formatting a Chinese book with Prince, and I now have a problem when adjusting justified text. I have a paragraph, see the following picture:



For this paragraph I have set the following properties:

text-align: justify;
prince-text-justify: prince-cjk;


and now suppose I need to adjust the text to avoid the line breaking before the "dash", i.e. to move the last character in the first line down to the second line. I tried to wrap the characters around the dash with a "span" tag with the property "prince-wrap-inside: avoid", but it doesn't work. I also tried to add the property "prince-forced-breaks: full" to the paragraph's style and inserted a "br" before the last character of the first line, the line does break at that point, but the first line is short instead of being full and justified.

Any suggestions? Thanks a lot.

Edited by Shyujikou

mikeday
The prince-forced-breaks property is only supported in Prince for Books at this time. You could wrap it in a span and apply "white-space: nowrap", which will avoid breaking within the span.
Shyujikou
Thanks mike. As the texts are in Chinese and there are no white spaces, so I don't think white-space property will work. However, can I convert to Prince for Books in order to use these features? Is it completely compatible with the normal version of Prince?
mikeday
The "white-space: nowrap" property should still inhibit breaking of Chinese text; Prince acts as if adjacent CJK characters are separated by a zero-width space.
Shyujikou
OK, it really works! Very helpful, many thanks.