Dear Robert,
Philipp Gesang and I are currently updating the luaotfload and fontspec
packages for LuaTeX, most certainly for TeXLive 2013. This is quite a
heavy update and it implies some backward-incompatible changes in the
lua structures of the font files.
The attached patch microtype-patch.diff make microtype compatible with
the new luaotfload (TeXLive 2013) and the old one (TeXLive 2009-2012).
Also, luatexbase is now really widespread and stable, while luatextra is
deprecated, so the attached patch microtype-patch-luatexbase.diff makes
microtype use luatexbase instead of luatextra. Also, luatexbase is
really available everywhere so I made it a requirement, but feel free to
do otherwise... I think it is safe though.
Please tell me your feeling about this. Do you think you could make an
update for TeXLive 2013 (freezing on May 20th)?
Thank you very much,
--
Elie
--- ../microtype-2.5/microtype.dtx 2013-03-13 06:02:02.000000000 +0100
+++ microtype.dtx 2013-04-13 22:39:37.147483880 +0200
@@ -8141,11 +8141,19 @@
%<*luafile>
function microtype.name_to_slot(name)
if fonts then
- local tfmdata = fonts.ids[font.current()]
- if tfmdata and tfmdata.shared then
- local otfdata = tfmdata.shared.otfdata
- local unicode = otfdata.luatex.unicodes[name]
- return unicode and (type(unicode) == "number" and unicode or unicode[1])
+ local unicodes
+ if fonts.ids then --- legacy luaotfload
+ local tfmdata = fonts.ids[font.current()]
+ if not tfmdata then return end
+ unicodes = tfmdata.shared.otfdata.luatex.unicodes
+ else --- new location
+ local tfmdata = fonts.hashes.identifiers[font.current()]
+ if not tfmdata then return end
+ unicodes = tfmdata.resources.unicodes
+ end
+ local unicode = unicodes[name]
+ if unicode then --- does the 'or' branch actually exist?
+ return type(unicode) == "number" and unicode or unicode[1]
end
end
end
--- microtype.dtx-old 2013-04-14 15:15:19.000000000 +0200
+++ microtype.dtx 2013-04-14 15:24:42.000000000 +0200
@@ -3765,6 +3765,7 @@
% number.
%\changes{v2.3d}{2009/03/25}{update for \luatex\ 0.36}
% \begin{macrocode}
+\usepackage{luatexbase}
\def\MT@lua{\directlua}
\def\MT@luatex@no{3}
\ifnum\luatexversion<62
@@ -4004,15 +4005,10 @@
%\end{macro}
% Some functions are loaded from a dedicated |lua| file. This avoids character
% escaping problems and incompatibilities between versions of \luatex.
-% If available, we'll use the \pkg{luatextra} package to load the module.
+% We use the \pkg{luatexbase} package to load the module.
% \begin{macrocode}
%<*luatex-def>
-\MT@lua{
- if (luatextra and luatextra.use_module) then
- luatextra.use_module("microtype")
- else
- dofile(kpse.find_file("microtype.lua"))
- end}
+\RequireLuaModule{microtype}
%</luatex-def>
% \end{macrocode}
% Here it begins. The module was contributed by \'Elie Roux.
@@ -4036,8 +4032,8 @@
license = "LPPL",
}
-if luatextra and luatextra.provides_module then
- luatextra.provides_module(microtype.module)
+if luatexbase and luatexbase.provides_module then
+ luatexbase.provides_module(microtype.module)
end
%</luafile>