<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Arial,Helvetica,sans-serif'>
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">What you are describing sounds like a greedy algorithm. Is that correct? For a project of mine I'm thinking about implementing a minimum raggedness algorithm as implemented by TeX hence my question.<br /><br />Regards, Darius<br /> <br /> <br /> Andreas Vox schreef op 10 jul '15: <br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">Hi,<br /> <br /> no, there is no document describing Scribus' layout algorithm (safe for the<br /> source code :-) )<br /> <br /> The line breaking und justification should work like this:<br /> <br /> 0. Assume natural glyph width and normal word spacing<br /> 1. Fill the line with words until a word spills over the end of the line. <br /> 2. If hyphenation is on, hyphenate that word<br /> 3. Remember the difference D between the length of the words collected for<br /> this line so far and the regular line length.<br /> 4. Remember the difference D' between the regular line length and the length<br /> of all collected words but the last on (D' > 0)<br /> 3. Test if after applying minimal word spacing and minimal glyph stretch the<br /> line is shorter or equal to the regular line length<br /> 4. If yes and D < D', apply min. glyph stretch and minimal word spacing<br /> such that the words fit the line.<br /> 5. Otherwise, apply max. glyph stretch and increase word spacing so that the<br /> word fit the line.<br /> <br /> Of course 5. only happens if justification is on.<br /> <br /> /Andreas<br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">-----Ursprüngliche Nachricht-----<br /> Von: Darius Blaszyk [mailto:<a href="mailto:dhkblaszyk@zeelandnet.nl">dhkblaszyk@zeelandnet.nl</a>]<br /> Gesendet: Freitag, 10. Juli 2015 16:10<br /> An: <a href="mailto:scribus@lists.scribus.net">scribus@lists.scribus.net</a><br /> Betreff: [scribus] Word wrapping algorithm<br /> <br /> Hi all,<br /> <br /> I was wondering which algorithm Scribus uses to do word wrapping and where<br /> to find it in the source code. Is there somewhere a document describing</blockquote>
the <br /> <br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">workings of the render and layout pipeline?<br /> <br /> Regards, Darius<br /> <br /> -------------- next part --------------<br /> An HTML attachment was scrubbed...<br /> URL:<br /> <<a href="http://lists.scribus.net/pipermail/scribus/attachments/20150710/dc5654dc/" target="_blank" rel="noreferrer">http://lists.scribus.net/pipermail/scribus/attachments/20150710/dc5654dc/</a> [<a href="http://lists.scribus.net/pipermail/scribus/attachments/20150710/dc5654dc/" target="_blank" rel="noreferrer">1</a>]<br /> attachment.html><br /> ___<br /> Scribus Mailing List: <a href="mailto:scribus@lists.scribus.net">scribus@lists.scribus.net</a> Edit your options or<br /> unsubscribe:<br /> <a href="http://lists.scribus.net/mailman/listinfo/scribus" target="_blank" rel="noreferrer">http://lists.scribus.net/mailman/listinfo/scribus</a> [<a href="http://lists.scribus.net/mailman/listinfo/scribus" target="_blank" rel="noreferrer">2</a>]<br /> See also:<br /> <a href="http://wiki.scribus.net" target="_blank" rel="noreferrer">http://wiki.scribus.net</a> [<a href="http://wiki.scribus.net" target="_blank" rel="noreferrer">3</a>]<br /> <a href="http://forums.scribus.net" target="_blank" rel="noreferrer">http://forums.scribus.net</a> [<a href="http://forums.scribus.net" target="_blank" rel="noreferrer">4</a>]</blockquote>
<br /> ___<br /> Scribus Mailing List: <a href="mailto:scribus@lists.scribus.net">scribus@lists.scribus.net</a><br /> Edit your options or unsubscribe:<br /> <a href="http://lists.scribus.net/mailman/listinfo/scribus" target="_blank" rel="noreferrer">http://lists.scribus.net/mailman/listinfo/scribus</a> [<a href="http://lists.scribus.net/mailman/listinfo/scribus" target="_blank" rel="noreferrer">2</a>]<br /> See also:<br /> <a href="http://wiki.scribus.net" target="_blank" rel="noreferrer">http://wiki.scribus.net</a> [<a href="http://wiki.scribus.net" target="_blank" rel="noreferrer">3</a>]<br /> <a href="http://forums.scribus.net" target="_blank" rel="noreferrer">http://forums.scribus.net</a> [<a href="http://forums.scribus.net" target="_blank" rel="noreferrer">4</a>]</blockquote>
<br /> <br /> Links:<br /> ------<br /> [1] <a href="http://lists.scribus.net/pipermail/scribus/attachments/20150710/dc5654dc/" target="_blank" rel="noreferrer">http://lists.scribus.net/pipermail/scribus/attachments/20150710/dc5654dc/</a><br /> [2] <a href="http://lists.scribus.net/mailman/listinfo/scribus" target="_blank" rel="noreferrer">http://lists.scribus.net/mailman/listinfo/scribus</a><br /> [3] <a href="http://wiki.scribus.net" target="_blank" rel="noreferrer">http://wiki.scribus.net</a><br /> [4] <a href="http://forums.scribus.net" target="_blank" rel="noreferrer">http://forums.scribus.net</a></div>
</body></html>