Justifying text.

François Pinard pinard at iro.umontreal.ca
Sat Sep 29 16:20:55 EDT 2001


[Magnus Lie Hetland]
> [Boyd Roberts]
> > [A.A]

> > > In most traditional heavy-weight text editors written in C, there
> > > is an option to justify.  Do the programmers use a traditional
> > > method/formula ?
> >
> > a 'text editor' that justifies text is not a text editor.

> What - you haven't heard of Emacs?  And C-u M-q?  (I'm sure vi has the
> same functionality, as does the UNIX program fmt.)

A few comments on that topic.

* a `text editor' having useful functionalities is still a `text editor'.

* `M-q' in Emacs does an elementary fill.  See GNU `fmt' for a more
  sophisticated algorithm (the so-called `Knuth' algorithm, which uses
  dynamic programming techniques to consider each paragraph as a whole).
  I managed locally so `M-q' uses that `fmt' instead of the Emacs built-in.

* `C-u M-q' is a very poor command to use with fixed width fonts.  I have this
  text among my canned replies: 

     Simultaneous left and right justification is inappropriate with
     fixed width font texts.  Even if they are nicer to observe, this is
     known to decrease readability.  We should not loose sight that the
     true goal of typography is to increase readability, not aesthetics.
     The latter does not necessarily implies the former.

  Sadly enough, many `man' programs implies such a presentation by default,
  much beyond the limits of good taste.  Many of you might surely have
  noticed how difficult it is to decipher some of these pages.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list