[pdftex] Correct use of font expansion.

Reinhard Kotucha reinhard.kotucha at web.de
Thu Sep 27 00:27:22 CEST 2007


Thanh Han The writes:

 >On Wed, Sep 26, 2007 at 10:06:20AM -0400, John Culleton wrote:

 >> I use plain pdftex. Here is my current setup:
 >> ----------------------------------------------
 >> \pretolerance 200
 >> \tolerance 400
 >> ...
 >> \font\rm putr8r at 10pt
 >> ...
 >> \rm
 >> \input protcode.tex
 >> \pdfprotrudechars=2
 >> \setprotcode\font
 >> \pdffontexpand\rm 20 20 5 autoexpand
 >> --------------------------------------------
 >>
 >> Is this code correct and sufficient?  It does not yield an error
 >> message but I still have problems with a few overflow lines in my
 >> text, in particular a long word at the end of the first line of a
 >> paragraph thus:
 >> -------------------------------------------------------------
 >> \par ``Consider me a representative of God on earth. Remember the
 >> Twenty-third (etc)
 >> --------------------------------------------------------------
 >> The word fragment "Twenty" overflows the line. I can hyphenate it
 >> to Twen\-ty but this puts an additional hyphen in a word already
 >> hyphenated.
 >>
 >> If my micrographic expansion code is functioning then I can take
 >> other means to eliminate the error, such as inserting \break after
 >> "Remember the", or negative kerning between words etc. .  But I
 >> want to make sure that micrographic expansion and contraction is
 >> correctly configured first.
 
 > I would add the following:
 > 
 > ,--------
 > | \tolerance=9999
 > | \pdfadjustspacing=2
 > `--------

\tolerance=9999 usually provides very bad output.  Maybe John has to
deal with narrow columns, then something like that cannot always be
avoided, unfortunately.

John, before you allow for larger interword glue, it seems worthwhile
to experiment with \pdffontexpand arguments.  Font expansion should
not be visible, but what you currently have is an expansion factor of
2%. This is definitely not visible.  But maybe 3% or 4% is acceptable
for you.

On the other hand, \tolerance=400 is fine in most cases, but in
multi-column environments one probably has to be more tolerant.  But
\tolerance=9999 sounds like brute force.  Maybe a smaller value of
\hyphenpenalty is useful.  The default value of \doublehyphendemerits
is 10,000.  This is fine for large values of \hsize but it's
worthwhile to decrease it if you are working in a less friendly
environment.

I'm sure that you get best results if you experiment with all of them,
\tolerance, \pdffontexpand, and hyphenation stuff.  

Regarding paragraph formatting, I'm not sure, but I remember vaguely
that Phil Taylor wrote a TUGboat article about it many years ago.
Maybe someone else can tell you more.

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha			              Phone: +49-511-4592165
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------


More information about the pdftex mailing list