[luatex] Question regarding lang.hyphenation

Patrick Gundlach patrick at gundla.ch
Tue Jan 11 16:11:50 CET 2011


Hi all,

see the attached code. It creates a new dummy language, adds a hyphenation exception ("Au-to-bahn"), calls lang.hyphenate() but no disc node has been created. I would have expected two disc nodes at the places where I put the dashes in the hyphenation exception.

Perhaps I am using it incorrectly?

Patrick

--------------------------------------------------------------------------------
\directlua{
 local l = lang.new(99)
 lang.hyphenation(l, "Au-to-bahn")

 local char,head,n,last
 for s in string.utfvalues("Autobahn") do
  char = unicode.utf8.char(s)
  n = node.new("glyph")
  n.subtype = 1
  n.font = 1
  n.char = s
  n.lang = 99
  n.left = 1
  n.right = 1

  
  if head then
    last.next = n
  else
    head = n
  end
  last = n
 end

 node.slide(head)
 assert(lang.hyphenate(head),"lang.hyphenate")

 local cur = head
 while cur do
  if cur.id == 7 then
  texio.write_nl( "----  a disc node! " ) % never printed
  end
  cur = cur.next
 end
}
\bye
--------------------------------------------------------------------------------




More information about the luatex mailing list