summaryrefslogtreecommitdiff
path: root/support/luafindfont/scripts
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-09-03 03:00:39 +0000
committerNorbert Preining <norbert@preining.info>2022-09-03 03:00:39 +0000
commitaad0212913f1ba7176d3d187a33e955804ad271d (patch)
treec34f103e0020e2eaa6b160fe4bacb3d95ced530f /support/luafindfont/scripts
parentc40a6fff24b4851c4d27d3118cca2bd81cb82a5a (diff)
CTAN sync 202209030300
Diffstat (limited to 'support/luafindfont/scripts')
-rwxr-xr-xsupport/luafindfont/scripts/luafindfont.lua22
1 files changed, 14 insertions, 8 deletions
diff --git a/support/luafindfont/scripts/luafindfont.lua b/support/luafindfont/scripts/luafindfont.lua
index d3532b643e..f1d513a508 100755
--- a/support/luafindfont/scripts/luafindfont.lua
+++ b/support/luafindfont/scripts/luafindfont.lua
@@ -4,10 +4,10 @@
-- FILE: luafindfont.lua
-- DESCRIPTION: search for fonts in the database
-- REQUIREMENTS: luatex v.0.80 or later; packages lualibs, xindex-lapp
--- AUTHOR: Herbert Voß (C) 2022-05-05
+-- AUTHOR: Herbert Voß (C) 2022-09-02
-----------------------------------------------------------------------
luafindfont = luafindfont or { }
- local version = 0.09
+ local version = 0.10
luafindfont.version = version
--[[
@@ -146,11 +146,10 @@ if vlevel > 0 then
print("We are using "..luaVersion)
if font_str[2] ~= "" then
print('Looking for font \"'..font_str[1]..' & '..font_str[2]..'\"')
+ else
+ print('Looking for font \"'..font_str[1]..'\"')
end
end
-if font_str[1] == "*" or vlevel > 0 then
- print('Looking for font \"'..font_str[1]..'\"')
-end
function getFileParts(fullpath,part)
local path, file, ext = string.match(fullpath, "(.-)([^/]-([^%.]+))$")
@@ -172,17 +171,24 @@ function getFileLocation()
print("No cache path found ... ")
return ""
end
- if os.type == "windows" then
+ local windows = (os.type == "windows")
+ if windows then logprint ("System: Windows")
+ else logprint ("System: macOS or Linux")
+ end
+ if windows then
paths = string.split(cachepaths,";")
else
paths = string.split(cachepaths,":")
end
- logprint ("Pathes: "..paths[1]..", "..paths[2])
+ logprint ("Paths: [1]"..paths[1])
+ if #paths > 1 then
+ logprint(" [2]"..paths[2])
+ end
local file = paths[1].."/luatex-cache/generic/names"
logprint("try path: "..file)
local f,err = io.open (file.."/test.tmp", "w")
if not f and #paths > 1 then
- logprint("first path has no file, I'll try the second one ...")
+ logprint("first path has no file, I'll try the second one, if exists ...")
file = paths[2].."/luatex-cache/generic/names"
logprint("try path: "..file)
f,err = io.open (file.."/test.tmp", "w")