summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx97
1 files changed, 20 insertions, 77 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
index c37e446ac83..90d9ceb11ae 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3luatex.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3luatex.dtx Copyright (C) 2010-2016 The LaTeX3 Project
+%% File: l3luatex.dtx Copyright (C) 2010-2017 The LaTeX3 Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -24,7 +24,7 @@
\documentclass[full]{l3doc}
%</driver>
%<*driver|package&tex>
-\GetIdInfo$Id: l3luatex.dtx 6805 2016-12-28 22:15:52Z joseph $
+\GetIdInfo$Id: l3luatex.dtx 6953 2017-02-18 19:07:54Z joseph $
{L3 Experimental LuaTeX-specific functions}
%</driver|package&tex>
%<*driver>
@@ -277,96 +277,39 @@ l3kernel.charcat = charcat
% \end{macrocode}
% \end{macro}
%
-% \begin{macrocode}
-%</lua>
-% \end{macrocode}
+% \subsection{Generic \Lua{} and font support}
%
% \begin{macrocode}
-%</initex|package>
+%<*initex>
% \end{macrocode}
%
-% \subsection{Format mode code: font loader}
-%
+% A small amount of generic code is used by almost all \LuaTeX{} material so
+% needs to be loaded by the format.
% \begin{macrocode}
-%<*fontloader>
+attribute_count_name = "g__alloc_attribute_int"
+bytecode_count_name = "g__alloc_bytecode_int"
+chunkname_count_name = "g__alloc_chunkname_int"
+whatsit_count_name = "g__alloc_whatsit_int"
+require("ltluatex")
% \end{macrocode}
%
-% In format mode, there needs to be a font loader available to let us
-% use OpenType fonts. For testing, this is provided by
-% \texttt{fontloader.lua} from the Speedata Publisher system
-% (\url{https://github.com/speedata/publisher}). The code there is designed
-% to be self-contained and has a certain number of build-in assumptions,
-% so there is a small amount of compatibility required.
-%
-% The code we load looks up \texttt{texmf} tree files using
-% \texttt{kpse.filelist}, which isn't part of the standard \texttt{kpse}
-% library. The interface is emulated using metatable.
+% With the above available the font loader code used by plain \TeX{} and
+% \LaTeXe{} when used with \LuaTeX{} can be loaded here. This is thus being
+% treated more-or-less as part of the engine itself.
% \begin{macrocode}
-kpse.filelist = setmetatable({}, {
- __index = function (t, key)
- return kpse.lookup(key)
- end
-})
+require("luaotfload-main")
+local _void = luaotfload.main()
% \end{macrocode}
-% There is a built-in assumption in \texttt{fontloader.lua} that various
-% environmental variables are set. We deal with that by intercepting the
-% relevant names and returning something sane.
% \begin{macrocode}
-local os_getenv = os.getenv
-function os.getenv (var)
- if var == "SP_FONT_PATH" then return "" end
- return os_getenv(var)
-end
+%</initex>
% \end{macrocode}
-% As detailed in
-% \url{https://github.com/speedata/publisher/blob/develop/COPYING}, the current
-% license for Speedata Publisher is \textsc{AGPLv3}. We therefore only
-% load the file and use its public interfaces rather than copying/modifying
-% the code itself. Note though that we do have permission to use
-% \texttt{fontloader.lua} as a public domain work
-% (\url{http://chat.stackexchange.com/transcript/message/27273687#27273687}):
-% if we want to develop a richer loader we may want to take advantage of that
-% (which also applies to the simple shaper in the related \texttt{fonts.lua}
-% file).
-% \begin{macrocode}
-local fontloader = require("fontloader.lua")
-% \end{macrocode}
-% That done, register a callback which at present simply passes everything
-% through. There's no attempt to pick up font settings (which presumably
-% will be needed). Syntax is coerced to the same as for \XeTeX{}.
+%
% \begin{macrocode}
-callback.register("define_font",
- function (name, size, id)
- local opts, opttab, otfeatures = "", { }, { }
- if string.match(name, "^%[") then
- name, opts = string.match(name, "^%[([^%]]*)%][^:]*:?(.*)")
- end
- if opts ~= "" then
- for _,kv in ipairs(string.explode(opts,";")) do
- if string.match(kv, "=") then
- local k, v = string.match(kv, "([^=]*)=?(.*)")
- opttab[k] = v
- else
- if string.match(kv, "^+") then
- otfeatures[string.sub(kv,2,-1)] = "true"
- elseif string.match(kv, "^-") then
- otfeatures[string.sub(kv,2,-1)] = "false"
- else
- otfeatures[kv] = "true"
- end
- end
- end
- end
- if next(otfeatures) then
- opttab["otfeatures"] = otfeatures
- end
- return select(2, fontloader.define_font(name, size, opttab))
- end
-)
+%</lua>
% \end{macrocode}
%
% \begin{macrocode}
-%</fontloader>
+%</initex|package>
% \end{macrocode}
%
%\end{implementation}