summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua61
1 files changed, 37 insertions, 24 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
index 343abc5f830..0de49c021fe 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload.lua
@@ -26,11 +26,12 @@ local luaotfload = luaotfload
config = config or { }
config.luaotfload = config.luaotfload or { }
-------.luaotfload.resolver = config.luaotfload.resolver or "normal"
-config.luaotfload.resolver = config.luaotfload.resolver or "cached"
-config.luaotfload.definer = config.luaotfload.definer or "patch"
+------.luaotfload.resolver = config.luaotfload.resolver or "normal"
+config.luaotfload.resolver = config.luaotfload.resolver or "cached"
+config.luaotfload.definer = config.luaotfload.definer or "patch"
+config.luaotfload.compatibility = config.luaotfload.compatibility or false
config.luaotfload.loglevel = config.luaotfload.loglevel or 1
-config.luaotfload.color_callback = config.luaotfload.color_callback or "pre_linebreak_filter"
+config.luaotfload.color_callback = config.luaotfload.color_callback or "pre_linebreak_filter"
--luaotfload.prefer_merge = config.luaotfload.prefer_merge or true
luaotfload.module = {
@@ -61,9 +62,6 @@ local reset_callback, call_callback =
local dummy_function = function () end
-
-luaotfload.font_definer = "patch" --- | ^^e2^^80^^9cgeneric^^e2^^80^^9d | ^^e2^^80^^9cold^^e2^^80^^9d
-
local error, warning, info, log =
luatexbase.provides_module(luaotfload.module)
@@ -82,7 +80,16 @@ if tex.luatexversion < luatex_version then
end
-local fl_prefix = "luaotfload" -- ^^e2^^80^^9cluatex^^e2^^80^^9d for luatex-plain
+local cachepath = kpse.expand_var"$TEXMFVAR"
+if not lfs.isdir(cachepath) then
+ dir.mkdirs(cachepath)
+ if not lfs.isdir(cachepath) then
+ error( "ERROR could not create directory %s", cachepath)
+ end
+end
+
+
+local fl_prefix = "luaotfload" -- “luatex” for luatex-plain
local loadmodule = function (name)
require(fl_prefix .."-"..name)
end
@@ -119,7 +126,7 @@ do
attributes = attributes or { }
attributes.private = function (name)
- local attr = "luaotfload@" .. name --- used to be: ^^e2^^80^^9cotfl@^^e2^^80^^9d
+ local attr = "luaotfload@" .. name --- used to be: “otfl@”
local number = the_attributes[attr]
if not number then
number = new_attribute(attr)
@@ -182,13 +189,13 @@ if fonts then
if not fonts._merge_loaded_message_done_ then
--- a program talking first person -- HH sure believes in strong AI ...
- log[[^^e2^^80^^9cI am using the merged version of 'luaotfload.lua' here. If]]
+ log[[“I am using the merged version of 'luaotfload.lua' here. If]]
log[[ you run into problems or experience unexpected behaviour,]]
log[[ and if you have ConTeXt installed you can try to delete the]]
log[[ file 'luaotfload-font-merged.lua' as I might then use the]]
log[[ possibly updated libraries. The merged version is not]]
log[[ supported as it is a frozen instance. Problems can be]]
- log[[ reported to the ConTeXt mailing list.^^e2^^80^^9d]]
+ log[[ reported to the ConTeXt mailing list.”]]
end
fonts._merge_loaded_message_done_ = true
@@ -251,24 +258,32 @@ add_to_callback("find_vf_file",
find_vf_file, "luaotfload.find_vf_file")
loadmodule"lib-dir.lua" --- required by luaofload-database.lua
-loadmodule"override.lua" --- ^^e2^^80^^9cluat-ovr^^e2^^80^^9d
+loadmodule"override.lua" --- “luat-ovr”
logs.set_loglevel(config.luaotfload.loglevel)
-loadmodule"loaders.lua" --- ^^e2^^80^^9cfont-pfb^^e2^^80^^9d new in 2.0, added 2011
-loadmodule"database.lua" --- ^^e2^^80^^9cfont-nms^^e2^^80^^9d
-loadmodule"colors.lua" --- ^^e2^^80^^9cfont-clr^^e2^^80^^9d
+loadmodule"loaders.lua" --- “font-pfb” new in 2.0, added 2011
+loadmodule"database.lua" --- “font-nms”
+loadmodule"colors.lua" --- “font-clr”
local request_resolvers = fonts.definers.resolvers
local formats = fonts.formats
formats.ofm = "type1"
-request_resolvers.file = function (specification)
- local found = fonts.names.crude_file_lookup(specification.name)
- --local found = fonts.names.crude_file_lookup_verbose(specification.name)
- specification.name = found[1]
- --if format then specification.forced = format end
+
+local resolvefile = fonts.names.crude_file_lookup
+--local resolvefile = fonts.names.crude_file_lookup_verbose
+
+function request_resolvers.file(specification)
+ local name=resolvefile(specification.name)
+ local suffix=file.suffix(name)
+ if formats[suffix] then
+ specification.forced=suffix
+ specification.name=file.removesuffix(name)
+ else
+ specification.name=name
+ end
end
@@ -305,7 +320,7 @@ local read_font_file = fonts.definers.read
local patch_defined_font = function (specification, size, id)
local tfmdata = read_font_file(specification, size, id)
if type(tfmdata) == "table" and tfmdata.shared then
- --- We need to test for the ^^e2^^80^^9cshared^^e2^^80^^9d field here
+ --- We need to test for the “shared” field here
--- or else the fontspec capheight callback will
--- operate on tfm fonts.
call_callback("luaotfload.patch_font", tfmdata)
@@ -313,8 +328,6 @@ local patch_defined_font = function (specification, size, id)
return tfmdata
end
-caches.compilemethod = "both"
-
reset_callback("define_font")
@@ -332,7 +345,7 @@ elseif font_definer == "patch" then
1)
end
-loadmodule"features.lua" --- contains what was ^^e2^^80^^9cfont-ltx^^e2^^80^^9d and ^^e2^^80^^9cfont-otc^^e2^^80^^9d
+loadmodule"features.lua" --- contains what was “font-ltx” and “font-otc”
loadmodule"auxiliary.lua" --- additionaly high-level functionality (new)
-- vim:tw=71:sw=4:ts=4:expandtab