Le 11/01/2011 16:11, Patrick Gundlach a écrit :
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

You should set uchyph=1 for all nodes, since Autobahn since starts with an uppercase letter.

Best,
Paul

Reply via email to