summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luaotfload-auxiliary.lua31
-rw-r--r--luaotfload.dtx2
2 files changed, 29 insertions, 4 deletions
diff --git a/luaotfload-auxiliary.lua b/luaotfload-auxiliary.lua
index d6c8eaa..0a3ace8 100644
--- a/luaotfload-auxiliary.lua
+++ b/luaotfload-auxiliary.lua
@@ -48,10 +48,33 @@ local rewrite_fontname = function (tfmdata, specification)
tfmdata.name = [["]] .. specification .. [["]]
end
-luatexbase.add_to_callback(
- "luaotfload.patch_font",
- rewrite_fontname,
- "luaotfload.rewrite_fontname")
+local rewriting = false
+
+local start_rewrite_fontname = function ()
+ if rewriting == false then
+ luatexbase.add_to_callback (
+ "luaotfload.patch_font",
+ rewrite_fontname,
+ "luaotfload.rewrite_fontname")
+ rewriting = true
+ logs.names_report ("log", 0, "aux",
+ "start rewriting tfmdata.name field")
+ end
+end
+
+aux.start_rewrite_fontname = start_rewrite_fontname
+
+local stop_rewrite_fontname = function ()
+ if rewriting == true then
+ luatexbase.remove_fromt_callback
+ ("luaotfload.patch_font", "luaotfload.rewrite_fontname")
+ rewriting = false
+ logs.names_report ("log", 0, "aux",
+ "stop rewriting tfmdata.name field")
+ end
+end
+
+aux.stop_rewrite_fontname = stop_rewrite_fontname
--- as of 2.3 the compatibility hacks for TL 2013 are made optional
diff --git a/luaotfload.dtx b/luaotfload.dtx
index d647efb..2344a19 100644
--- a/luaotfload.dtx
+++ b/luaotfload.dtx
@@ -2044,6 +2044,8 @@ loadmodule"features.lua" --- contains what was “font-ltx” and “font-otc
loadmodule"extralibs.lua" --- load additional Context libraries
loadmodule"auxiliary.lua" --- additionaly high-level functionality (new)
+luaotfload.aux.start_rewrite_fontname () --- to be migrated to fontspec
+
-- vim:tw=71:sw=4:ts=4:expandtab
% \end{macrocode}