[luatex] strategy for margin kerning and pre_linebreak_filter?

Patrick Gundlach patrick at gundla.ch
Thu Oct 1 11:31:19 CEST 2009


Hello Taco,

Am 01.10.2009 um 09:52 schrieb Taco Hoekwater:
> Patrick Gundlach wrote:
>>
>> So the problem seems to be that when hyphenating the second  
>> paragraph,
>> the hyphen will stick inside the paragraph. Am I missing something  
>> here?
>> See also tracker item #274
>
> I would hazard a guess that the inserted hyphen comes from the wrong
> font (the currently active font).

That is true (probably same in tracker #273).

> A solution could be to run lang.hyphenate() inside the filter, and
> only afterwards adjust the font ids?

lang.hyphenate() inserts disc nodes, right? I am pretty sure that the  
disc nodes are already in the node list. This is what the node list  
looks like on a sample text (--- denotes a disc node, space a glue,  
the rest a glyph node) in the pre_linebreak_filter:

Far far away, be---hind the word moun---tains, far from the coun---tries
  Vokalia and Con---so---nan---tia, there live the blind texts.  
Separated they l
ive in Book---marks---grove right at the coast of the Seman---tics, a  
large lan
---guage ocean. A small river named Duden flows by their place and  
sup---plies
it with the nec---es---sary regelialia. It is a par---adis---e---matic  
coun---t
ry, in which roasted parts of sen---tences fly into your mouth. Even  
the all---
-powerful Point---ing has no con---trol about the blind texts  it is  
an al---mo
st un---ortho---graphic life.


I have no idea about TeX internals, but it looks to me as if the  
procedure that inserts a hyphen char should take this hyphen char from  
the last glyph right before the hyphen char. This would be the "e" in  
"be---hind", the first "n" in "moun---tains" etc. Or one should be  
able to change the font of the disc node as well (node.font=n where  
node.id==7). Otherwise being able to change the font of the glyphs  
during the pre-linebreak-filter makes no sense to me.

What do you think?

Patrick



More information about the luatex mailing list