[NTG-pdftex] [ pdftex-Bugs-712 ] problems with \letterspacefont

noreply at sarovar.org noreply at sarovar.org
Thu Feb 22 10:31:21 CET 2007


Bugs item #712, was opened at 2006-12-12 02:53
You can respond by visiting: 
http://sarovar.org/tracker/?func=detail&atid=493&aid=712&group_id=106

Category: hz
Group: v1.40.0
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Robert (schlcht)
Assigned to: The Thanh Han (hanthethanh)
Summary: problems with \letterspacefont

Initial Comment:
% Testing the new \letterspacefont, I found:
%
% (1) it's certainly not correct to have the spacing 
%     relative to character widths (look at `minimal'!)
% (2) everything's shifted to the right
% (3) when trying to expand the letter-spaced font, I 
%     get the warning `font should be expanded before 
%     its first use' (even before its first use), and 
%     then pdftex segfaults.

\pdfadjustspacing2
\hsize13cm
This is normal text This is normal text 
This is normal text This is normal text 
This is normal text This is normal text
{\letterspacefont\lspfont=\font 1000
%\pdffontexpand\lspfont 20 20 5 autoexpand % segfault
\lspfont
This isn't normal text This isn't normal text
This isn't normal text This is minimal text}
This is normal text This is normal text 
This is normal text
\bye





----------------------------------------------------------------------

>Comment By: The Thanh Han (hanthethanh)
Date: 2007-02-22 09:31

Message:
Logged In: YES 
user_id=710

yes it sounds reasonable. Or we can extend the syntax of
\letterspacefont so that if an optional keyword like 'nolig'
is found then ligatures will be disabled.

----------------------------------------------------------------------

Comment By: Robert (schlcht)
Date: 2007-02-22 02:54

Message:
Logged In: YES 
user_id=2217

The current situation with regards to the lack of kerning of
letterspaced fonts is not really satisfying. After some
consideration, I therefore think it is actually better *not*
to disable ligatures, and hence kerning, for letterspaced fonts.

So I would propose to remove the line:
     set_no_ligatures(k); {disable ligatures for
letter-spaced fonts}

It is easy enough for the high-level interfaces (microtype,
context) to (automatically) disable selected ligatures only,
so that kerning for the rest of the characters is still
available. 

What do you think?

\letterspacefont\lsfont\font 100 \lsfont
\tagcode\lsfont`f -1
VALID off --
\bye


----------------------------------------------------------------------

Comment By: The Thanh Han (hanthethanh)
Date: 2007-02-02 13:54

Message:
Logged In: YES 
user_id=710

the warning message can be removed. I left it there since I
don't know what happens if a virtual font is loaded, used
and then expanded and used again with font expansion. It
should be alright to do so, but I am not very sure. Anyway,
I will change the warning to be issued for non-virtual fonts
only.

It turned to be a design mistake that the  \pdffontexpand
primitive takes a base font and turns it to an expanded
font. It would be better it was more like \letterspacefont,
ie it should create a new font and leave the original font
intact.

----------------------------------------------------------------------

Comment By: Taco Hoekwater (taco)
Date: 2007-02-02 07:30

Message:
Logged In: YES 
user_id=1608

> I hope luatex will abolish with this nonsensical connexion
of ligatures and kerns?

Yes. ligatures and kerns are totally separate in luatex.


----------------------------------------------------------------------

Comment By: Robert (schlcht)
Date: 2007-02-01 19:02

Message:
Logged In: YES 
user_id=2217

If the warning is misleading, should it not be removed?

On a different matter: Since \letterspacefont issues
set_no_ligatures, there won't be any kerning, either.
There's no way around that, I guess?

(I hope luatex will abolish with this nonsensical connexion
of ligatures and kerns?)


----------------------------------------------------------------------

Comment By: The Thanh Han (hanthethanh)
Date: 2007-01-04 15:59

Message:
Logged In: YES 
user_id=710

The warning is misleading but harmless. The reason of the
warning is that pdftex checks whether a font has not been
used before expansion (its type has not been examined and is
new/unknown yet). \letterspacefont sets the type of \y as a
virtual font, thus pdftex thinks the font might have been
used before. 

----------------------------------------------------------------------

Comment By: Robert (schlcht)
Date: 2007-01-04 00:40

Message:
Logged In: YES 
user_id=2217

I'm a bit confused about the status of (3): letterspacing
and expansion:
When expanding a letterspaced font, pdftex issues the
warning: ``font should be expanded before its first use'',
but apart from that, I cannot see any problems -- the font
is both letterspaced and expanded. 
Or is there a reason for the warning?

\pdfadjustspacing2
\font\x=cmr10 \x
\letterspacefont\y=\x 100 \y
\pdffontexpand\y 20 20 5 autoexpand
...
\bye


----------------------------------------------------------------------

Comment By: Martin Schröder (oneiros)
Date: 2006-12-21 16:09

Message:
Logged In: YES 
user_id=421

A patch for this will be included in the next version (1.40).

----------------------------------------------------------------------

Comment By: The Thanh Han (hanthethanh)
Date: 2006-12-12 17:47

Message:
Logged In: YES 
user_id=710

oops, I disabled ligature for letter-spaced font, but this
should not affect the base font. Will have to rethink. Most
likely the syntax will change like follows:

\letterspacefont\f=cmr10 at 11pt 100
\f text




----------------------------------------------------------------------

Comment By: Robert (schlcht)
Date: 2006-12-12 15:50

Message:
Logged In: YES 
user_id=2217

% and here's
% (4) ligatures will be broken up, not only in the 
%     letter-spaced font (which is probably acceptable), 
%     but in all subsequent uses of the base font, too

fi\par
{\letterspacefont\lspfont=\font 100 \lspfont fi}\par
fi

\bye



----------------------------------------------------------------------

Comment By: The Thanh Han (hanthethanh)
Date: 2006-12-12 13:31

Message:
Logged In: YES 
user_id=710

I fixed (1) and (2); (3) is disabled now, ie you cannot
expand a letter-spaced font. Please wait for another release
from Martin.

----------------------------------------------------------------------

You can respond by visiting: 
http://sarovar.org/tracker/?func=detail&atid=493&aid=712&group_id=106


More information about the ntg-pdftex mailing list