psliwa / PHPPdf

Pdf and graphic files generator library written in php
http://ohey.pl
MIT License
339 stars 77 forks source link

Prevent line-breaks between words #51

Open mbogucki opened 10 years ago

mbogucki commented 10 years ago

I'm looking for a way to prevent line-breaks between words. I tried it with wrapper spans and divs, several attributes (line-break:false, breakable:false, float, ... ) but nothing solved my problem. Is there another way to connect words and mark them as not breakable? Usecase: dynamic generated content with variable length.

psliwa commented 10 years ago

You can use   character (no breakable space),   doesn't work because it refers to common space in https://github.com/psliwa/PHPPdf/blob/master/lib/PHPPdf/Resources/dtd/doctype.dtd file (I will fix it). But when you use this kind of space, the whole text will be threaten as single word nonetheless it will be broken into several lines but not necessarily new line characters will appear in place of space (thanks to fix bug in https://github.com/psliwa/PHPPdf/issues/37 issue)