[scribus] Word wrapping algorithm
Darius Blaszyk
dhkblaszyk at zeelandnet.nl
Sun Jul 12 14:12:45 UTC 2015
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.
Regards, Darius
Andreas Vox schreef op 10 jul '15:
> Hi,
>
> no, there is no document describing Scribus' layout algorithm (safe for the
> source code :-) )
>
> The line breaking und justification should work like this:
>
> 0. Assume natural glyph width and normal word spacing
> 1. Fill the line with words until a word spills over the end of the line.
> 2. If hyphenation is on, hyphenate that word
> 3. Remember the difference D between the length of the words collected for
> this line so far and the regular line length.
> 4. Remember the difference D' between the regular line length and the length
> of all collected words but the last on (D' > 0)
> 3. Test if after applying minimal word spacing and minimal glyph stretch the
> line is shorter or equal to the regular line length
> 4. If yes and D < D', apply min. glyph stretch and minimal word spacing
> such that the words fit the line.
> 5. Otherwise, apply max. glyph stretch and increase word spacing so that the
> word fit the line.
>
> Of course 5. only happens if justification is on.
>
> /Andreas
>
>> -----Ursprüngliche Nachricht-----
>> Von: Darius Blaszyk [mailto:dhkblaszyk at zeelandnet.nl]
>> Gesendet: Freitag, 10. Juli 2015 16:10
>> An: scribus at lists.scribus.net
>> Betreff: [scribus] Word wrapping algorithm
>>
>> Hi all,
>>
>> I was wondering which algorithm Scribus uses to do word wrapping and where
>> to find it in the source code. Is there somewhere a document describing
> the
>
>> workings of the render and layout pipeline?
>>
>> Regards, Darius
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> <http://lists.scribus.net/pipermail/scribus/attachments/20150710/dc5654dc/ [1] [1 [1]]
>> attachment.html>
>> ___
>> Scribus Mailing List: scribus at lists.scribus.net Edit your options or
>> unsubscribe:
>> http://lists.scribus.net/mailman/listinfo/scribus [2] [2 [2]]
>> See also:
>> http://wiki.scribus.net [3] [3 [3]]
>> http://forums.scribus.net [4] [4 [4]]
>
> ___
> Scribus Mailing List: scribus at lists.scribus.net
> Edit your options or unsubscribe:
> http://lists.scribus.net/mailman/listinfo/scribus [2] [2 [2]]
> See also:
> http://wiki.scribus.net [3] [3 [3]]
> http://forums.scribus.net [4] [4 [4]]
Links:
------
[1]
http://lists.scribus.net/pipermail/scribus/attachments/20150710/dc5654dc/
[1]
[2] http://lists.scribus.net/mailman/listinfo/scribus [2]
[3] http://wiki.scribus.net [3]
[4] http://forums.scribus.net [4]
Links:
------
[1]
http://lists.scribus.net/pipermail/scribus/attachments/20150710/dc5654dc/
[2] http://lists.scribus.net/mailman/listinfo/scribus
[3] http://wiki.scribus.net
[4] http://forums.scribus.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20150712/38b5132c/attachment.html>
More information about the scribus
mailing list