diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2010-05-23 19:14:41 +0300 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2010-05-23 19:18:25 +0300 |
commit | a437a7d548ef91a9d20477cb075080296795e425 (patch) | |
tree | 77a21564c1c7912f5b2779e8ac3bcd5f10bd6520 | |
parent | 0b68011ac8f12dec8d0bc4209a794cd7c573ce5c (diff) | |
download | luaotfload-a437a7d548ef91a9d20477cb075080296795e425.tar.gz |
Switch to |luatexbase.new_attribute()|
-rw-r--r-- | luaotfload.dtx | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/luaotfload.dtx b/luaotfload.dtx index 1709267..28c1aeb 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -498,22 +498,19 @@ luaotfload.loadmodule('node-ini.lua') % \end{macrocode} % -% By default \ConTeXt\ takes some private attributes for internal use. With -% Plain and \LaTeX\ we can't do so, we use |\newluaattribute|. This -% functions overrides a function defined in the previous module that -% returns the number of a private attribute. We allocate new attributes in -% the \texttt{.sty} file, and this function returns their number. Like this -% we don't need any private attribute, and this package is compatible with -% the others. We use the |otfl@| prefix for attributes. +% By default \ConTeXt\ takes some private attributes for internal use. To +% avoide attribute clashes with other packages, we override the function +% that allocates new attributes, making it a wraper around +% |luatexbase.new_attribute()|. We also prefix attributes with |otfl@| to +% avoid possiple name clashes. % % \begin{macrocode} function attributes.private(name) - local number = luatexbase.attributes['otfl@'..name] + local attr = 'otfl@' .. name + local number = luatexbase.attributes[attr] if not number then - error('asking for attribute %s, but not declared. ' - ..'Please report to the maintainer of luaotfload.', - name) + number = luatexbase.new_attribute(attr) end return number end @@ -631,26 +628,6 @@ end % \end{macrocode} % -% The attributes are allocated here. The |otfl@| prefix is added to prevent -% name collision. The first attribute, |otfl@dummy|, is a dummy attribute -% because \ConTeXt\ code expects attribute |0| not to be used, but -% |\newluatexattribute| starts counting from zero. -% -% \begin{macrocode} - -\newluatexattribute\otfl@dummy -\newluatexattribute\otfl@state -\newluatexattribute\otfl@markbase -\newluatexattribute\otfl@markdone -\newluatexattribute\otfl@markmark -\newluatexattribute\otfl@cursbase -\newluatexattribute\otfl@curscurs -\newluatexattribute\otfl@cursdone -\newluatexattribute\otfl@kernpair -\newluatexattribute\otfl@color - -% \end{macrocode} -% % Two small macros to register or unregister the callbacks. Without the % callbacks this package is totally turned off. % |