Forum Bugs

Text overlapping/line breaking problem.

Eara_2018
There is a line breaking/text overlapping problems in chemical content. Attached is the snap images of problems. How to prevent this issue in PDF? Please advice.

  1. improperjustification.PNG21.7 kB
  2. linebreaking1.PNG75.0 kB
  3. linebreaking2.PNG76.8 kB
  4. linebreaking3.PNG63.9 kB
  5. linebreaking4.PNG83.1 kB
  6. linebreaking5.PNG144.2 kB
mikeday
Are those long words using regular hyphen-minus, or some other character like en-dash?

For example, this seems to work as expected:
<div style="width: 5cm; border: solid red thin; text-align: justify">
this is a test abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-
</div>
Eara_2018
I have used "hyphens:auto" in paragraph style. This seems to work as expected, but some places I found the same problem.

CSS:
abstract p, p {hyphens:auto !important;prince-linebreak-magic:auto !important;}
  1. linebreaking6.PNG222.4 kB
mikeday
Would you be able to email me (mikeday@yeslogic.com) some HTML and CSS that demonstrates the problem?
Eara_2018
Please find the attached HTML and CSS.
  1. fonts.zip564.0 kB
  2. template.css1.0 kB
  3. test.xhtml9.1 kB
mikeday
I can fix the overflow problem by this rather blunt solution:
body {
    prince-text-replace: '\2010' '-\200b'
}

This replaces the U+2010 HYPHEN characters with the regular hyphen-minus character followed by a zero-width space to allow line-breaking at that point.

It should guarantee no text overflow (assuming the words don't get longer than a column, which will require use of overflow-wrap: break-word) however it does result in some very unpleasant word gaps and awkward justification.
Eara_2018
I have tried this solution, no text overflow in the output. But it result some word gaps and awkward justification. Is there any other way to resolve the word gaps.
mikeday
It does a lot better when "hyphens: auto" is enabled as well, have you tried that?