summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-02-03 22:30:09 +0000
committerKarl Berry <karl@freefriends.org>2020-02-03 22:30:09 +0000
commit80eeb8a04335539fde455e00d5cfde4e2c7ed5c6 (patch)
treeb35ac34b9cccd54d049c68d5d808b9ed48bab65e /Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua
parentca44d57bbfaa45d580f466e5dff1b3a9cccd49f6 (diff)
luaotfload (3feb20)
git-svn-id: svn://tug.org/texlive/trunk@53652 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua31
1 files changed, 24 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua
index 2865bf55165..0f24e4542ec 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-loaders.lua
@@ -8,8 +8,8 @@
local ProvidesLuaModule = {
name = "luaotfload-loaders",
- version = "3.11", --TAGVERSION
- date = "2019-11-10", --TAGDATE
+ version = "3.12", --TAGVERSION
+ date = "2020-02-02", --TAGDATE
description = "luaotfload submodule / callback handling",
license = "GPL v2.0"
}
@@ -120,10 +120,20 @@ end
local definers --- (string, spec -> size -> id -> tmfdata) hash_t
do
- local read = fonts.definers.read
+ local ctx_read = fonts.definers.read
+ local register = fonts.definers.register
+ local function read(specification, size, id)
+ local tfmdata = ctx_read(specification, size, id)
+ if not tfmdata or id or tonumber(tfmdata) then
+ return tfmdata
+ end
+ id = font.define(tfmdata)
+ register(tfmdata, id)
+ return id
+ end
local patch = function (specification, size, id)
- local fontdata = read (specification, size, id)
+ local fontdata = ctx_read (specification, size, id)
----if not fontdata then not_found_msg (specification, size, id) end
if type (fontdata) == "table" and fontdata.encodingbytes == 2 then
--- We need to test for `encodingbytes` to avoid passing
@@ -133,7 +143,12 @@ do
else
luatexbase.call_callback ("luaotfload.patch_font_unsafe", fontdata, specification, id)
end
- return fontdata
+ if not fontdata or id or tonumber(fontdata) then
+ return fontdata
+ end
+ id = font.define(fontdata)
+ register(fontdata, id)
+ return id
end
local mk_info = function (name)
@@ -209,9 +224,11 @@ local install_callbacks = function ()
create_callback ("luaotfload.patch_font", "simple", dummy_function)
create_callback ("luaotfload.patch_font_unsafe", "simple", dummy_function)
purge_define_font ()
- local definer = config.luaotfload.run.definer
+ local definer = config.luaotfload.run.definer or "patch"
+ local selected_definer = definers[definer]
+ luaotfload.define_font = selected_definer
luatexbase.add_to_callback ("define_font",
- definers[definer or "patch"],
+ selected_definer,
"luaotfload.define_font",
1)
return true