texlive-specs-n/luaotfload_varfonts.dif

81 lines
2.6 KiB
Plaintext

---
texmf-dist/tex/luatex/luaotfload/luaotfload-fontloader.lua | 23 +++++++++++++++++++++
texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-merged.lua | 23 +++++++++++++++++++++
2 files changed, 46 insertions(+)
--- texmf-dist/tex/luatex/luaotfload/luaotfload-fontloader.lua
+++ texmf-dist/tex/luatex/luaotfload/luaotfload-fontloader.lua 2015-03-31 09:25:05.609518971 +0000
@@ -3170,12 +3170,35 @@ if not caches.namespace or caches.namesp
end
do
local cachepaths=kpse.expand_var('$TEXMFCACHE') or ""
+ local mktex=kpse.find_file('mktex.cnf','cnf') or ""
if cachepaths=="" or cachepaths=="$TEXMFCACHE" then
cachepaths=kpse.expand_var('$TEXMFVAR') or ""
end
if cachepaths=="" or cachepaths=="$TEXMFVAR" then
cachepaths=kpse.expand_var('$VARTEXMF') or ""
end
+ if mktex~="" then
+ local varfonts="no"
+ local features=io.open(mktex,'r')
+ local cache
+ for line in features:lines() do
+ if string.find(line, 'MT_FEATURES=') then
+ if string.find(line, 'varfonts') then
+ varfonts="yes"
+ end
+ break
+ end
+ end
+ features:close()
+ cache=kpse.expand_var('$VARTEXFONTS')
+ if varfonts=="yes" and cachepaths~="" then
+ if false == file.is_writable(cachepaths) then
+ cachepaths=os.getenv("HOME") .. "/.cache/texmf/fonts"
+ end
+ else
+ cachepaths=cache
+ end
+ end
if cachepaths=="" then
local fallbacks={ "TMPDIR","TEMPDIR","TMP","TEMP","HOME","HOMEPATH" }
for i=1,#fallbacks do
--- texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-merged.lua
+++ texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-merged.lua 2015-03-31 09:24:55.398018782 +0000
@@ -77,11 +77,34 @@ if not caches.namespace or caches.namesp
end
do
local cachepaths
+ local mktex=kpse.find_file('mktex.cnf','cnf') or ""
if kpse.expand_var('$TEXMFCACHE')~='$TEXMFCACHE' then
cachepaths=kpse.expand_var('$TEXMFCACHE')
elseif kpse.expand_var('$TEXMFVAR')~='$TEXMFVAR' then
cachepaths=kpse.expand_var('$TEXMFVAR')
end
+ if mktex~="" then
+ local varfonts="no"
+ local features=io.open(mktex,'r')
+ local cache
+ for line in features:lines() do
+ if string.find(line, 'MT_FEATURES=') then
+ if string.find(line, 'varfonts') then
+ varfonts="yes"
+ end
+ break
+ end
+ end
+ features:close()
+ cache=kpse.expand_var('$VARTEXFONTS')
+ if varfonts=="yes" and cache~="" then
+ if false == file.is_writable(cache) then
+ cachepaths=os.getenv("HOME") .. "/.cache/texmf/fonts"
+ else
+ cachepaths=cache
+ end
+ end
+ end
if not cachepaths then
cachepaths="."
end