php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14694 GNU fmt-like linebreak algorithm as PHP function
Submitted: 2001-12-25 18:16 UTC Modified: 2014-12-30 10:41 UTC
Votes:4
Avg. Score:3.5 ± 0.9
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: d-r at roettsches dot de Assigned:
Status: No Feedback Package: *General Issues
PHP Version: * OS: All
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: d-r at roettsches dot de
New email:
PHP Version: OS:

 

 [2001-12-25 18:16 UTC] d-r at roettsches dot de
Hi there,

I've been searching for a PHP implementation of the GNU textformatting tool fmt (http://www.gnu.org/software/textutils/textutils.html) which provides an almost optimal linebreak for your text.

It would be better to use than wordwrap() because it avoids breaking sentences after the first word or leaving dangling ends (paragraphs with only one word on the last line). The algorithm used by fmt is similar to the one used by Tex/Latex (proposed by a paper of Knuth et al.) and thus stands for optimal output quality.

My question is, if there's anyone who is interested in implementing this for PHP, so that we can see it in one of the next releases?

I think, the function would be very useful to do some pretty reformatting of text when for example sending mail or in general doing text formatted output.

Thanks for your help in advance,

Dominik

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-16 16:35 UTC] levim@php.net
-Status: Open +Status: Feedback -Package: Feature/Change Request +Package: *General Issues -PHP Version: 4.1.0 +PHP Version: *
 [2014-04-16 16:35 UTC] levim@php.net
Are you still interested in seeing this? As far as I know this still hasn't been implemented.
 [2014-12-30 10:41 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 06:01:28 2024 UTC