[NTG-context] lua code prevents compilation

Pablo Rodriguez oinos at gmx.es
Thu Apr 2 01:21:40 CEST 2015

On 03/30/2015 10:33 PM, Hans Hagen wrote:
> On 3/30/2015 5:19 PM, Pablo Rodriguez wrote:
>> [...]
>> 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:

Many thanks for your reply, Hans,

The following code shows the problem:


    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 },


%~ \definefontfamily[ornamenta][rm][TypographyTribute]
{\sethyphenationfeatures[underscore]\tt pandoc}

If you uncomment the line with the font definition, font loading crashes
compilation. It only crashes with this font
(http://www.dafont.com/typographytribute.font) or FontAwesome

Both lack the underscore glyph. This causes the crash, since it works
fine if I replace the glyph with an existing glyph in the font.

Error message:

code.tex: ! LuaTeX fatal error error in error handling
\font_helpers_low_level_define ...\scaledfontmode
                                                  \relax \ifcase
\font_helpers_trigger_define ..._identifier_class
\applyfontclassstrategies ...\fontface \endcsname
                                                  \else \expandafter
\font_helpers_synchronize_font ...classstrategies
                                                  \fi \setfalse
\rm ->\ifmmode \mathrm \else \normalrm
\font_basics_switch_style ...ntstyle #1\endcsname
                                                  \edef \fontstyle

Would it be possible that ConTeXt silently ignores that the font doesn’t
contain the glyph?

I think this might be a bug.

Many thanks for your help,


More information about the ntg-context mailing list