![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 3/30/2015 5:19 PM, Pablo Rodriguez wrote:
Dear list,
I have the following sample:
\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
\def\CoverImageFile{}%\externalfigure[TypeWriter][width=\textwidth]} \definefontfamily[ornamenta][rm][FontAwesome] \def\CoverImageFont{\scale[width=\textwidth]{\ornamenta }} \def\CoverImage{\doifsomethingelse{\CoverImageFile}{\CoverImageFile}{\CoverImageFont}}
\starttext \CoverImage \stoptext
For some reason unknown to me, the only way to compile the sample is to remove the luacode snippet.
I need the lua code to have underscore hyphenation in type commands. And I need two extra \definehyphenationfeatures and \sethyphenationfeatures to invoke it.
Have I hit a bug or what am I missing?
I don't know as i see nothing at all with that code .. this is more fun: \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 }, } } tfmdata.characters[0xFE001] = { width = 0, height = 0, depth = 0, commands = { { "down", char.depth }, { "slot", 1, underscore }, { "right", char.width }, } } end utilities.sequencers.appendaction("aftercopyingcharacters","after","document.addfunnyhyphen") \stopluacode \setuplanguage[en][righthyphenchar="FE000,lefthyphenchar="FE001] \starttext \input tufte \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------