home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.programming      Programming issues that transcend langua      57,431 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 56,977 of 57,431   
   Ben Bacarisse to Stefan Ram   
   Re: Paragraph Wrapping   
   27 Jan 23 01:22:19   
   
   From: ben.usenet@bsb.me.uk   
      
   ram@zedat.fu-berlin.de (Stefan Ram) writes:   
      
   >   To wrap a paragraph, I wrote a Python script that searched for   
   >   the best wrap, given a quality function that included penalties   
   >   for interpunction near the end of a line (but not at the end)   
   >   or adjacent lines that differed greatly in length.   
   >   
   >   It worked, but as the number of lines approached ten, it became   
   >   painfully slow.   
   >   
   >   By an incredible twist of fate, I came across a chapter of   
   >   a book that explained dynamic programming and how to use it   
   >   to reduce the complexity of global paragraph wrapping from   
   >   exponential to quadratic!   
      
   The TeX Book describes two-level algorithm to calculate optimal line   
   breaks in paragraphs and the optimal page breaks.   
      
   --   
   Ben.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca