Hans,

the sample below hyphenates right what comes before \TexC in the
paragraph. Also the contents of \TexC are hyphenated right.

But hyphen is removed from standard text after the last \TexC command in
the paragraph.

I have just accidentally discovered it.

Many thanks for your help,

Pablo



\startluacode

    function document.addfunnyhyphen(tfmdata)
        local underscore = utf.byte("_")
        local char       = tfmdata.characters[underscore]
        tfmdata.characters[0xFE000]   = {
            width    = 0,
            height   = 0,
            depth    = 0,
            commands = {
                { "right", -char.width },
                { "down", char.depth },
                { "slot", 1, underscore },
            }
        }
    end

utilities.sequencers.appendaction("aftercopyingcharacters","after","document.addfunnyhyphen")

\stopluacode

\definefontfamily[mainface][serif][GaramondNo8]
\definefontfamily[mainface][mono][Mechanica]
\setupbodyfont[mainface, 14pt]

\definetype
      [TeXcode]
      [option=TEX,
       compact=absolute,
       lines=hyphenated]

\definehyphenationfeatures
      [whatever]
      [righthyphenchar="FE000]

\setuphyphenation[method=traditional]
\sethyphenationfeatures[strict]

\unexpanded\def\TexC#1%
      {\dontleavehmode\begingroup
       \sethyphenationfeatures[whatever]%
       \normalexpanded{\TeXcode{\letterbackslash#1}}%
       \endgroup}

\starttext
        \hsize\zeropoint
        newlargewordwithhyphen
        \TexC{definebodyfont}
        newlargewordwithnohyphen
\stoptext

-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to