On Fri, May 21, 2010 at 02:53:30PM +0200, Manuel Pégourié-Gonnard wrote: > Le 21/05/2010 14:42, Khaled Hosny a écrit : > > After spending most of the day debugging why Arabic shaping is broken in > > the luaotfload, it turned out to be an attribute issue. The first > > allocated attribute by \newluatexattribute is 0 and ConTeXt code don't > > seem to like that, it specifically expects attributes used in luaotfload > > to be < 255 and > 127. > > > IMHO, it shouldn't expect that. I tend to call that broken, unless someone > provides me with a good explanation.
There are some comments in the code, but basically Hans doesn't allocate attributes at TeX end, and in lua he reserves ranges for special uses. The code has a function, attributes.private, that allocates attributes in this range, but we override it sense it doesn't check if the attribute is already allocated, our replacement hand allocate attributes using \newluatexattribute. > > The problem didn't show before switch to luatexbase, so I expect there > > was some change in how \newluatexattribute allocates new attributes. > > There was a minor change, I don't remember the details right now, but indeed > allocation didn't start at 0 previously for some reason. Since allocation > should > be a black box, I didn't expect the change to be noticeable, that's why I > didn't > announce it. I can work around it by allocating a dummy attribute first if you don't want to change it back, not a big deal. > > Also, to avoid any other hidden surprises, is there a way for luaotfload > > to assign attributes in the aforementioned range in a way that works > > nicely with the attributes package? > > > No. I can't see any nice way to to that. Well, if less than 127 attributes > have > been allocated, you could allocate dummy attributes up to 127, then start > allocating your attributes. If more than 255 attributes have already been > allocated, there's nothing you can do. OK, I wanted to be on the safe side, but lets just assume there no other problems beyond the one we just found. Regards, Khaled -- Khaled Hosny Arabic localiser and member of Arabeyes.org team Free font developer
