Skip to content

Commit

Permalink
Allow converting database into aliases for XeTeX
Browse files Browse the repository at this point in the history
  • Loading branch information
zauguin committed May 8, 2021
1 parent 3aefc9b commit e118e07
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/luaotfload-tool.lua 100644 → 100755
Expand Up @@ -736,7 +736,7 @@ local action_sequence = {
"config" , "loglevel" , "help" , "version" ,
"dumpconf" , "diagnose" , "blacklist" , "cache" ,
"flush" , "bisect" , "generate" , "list" ,
"query" ,
"query" , "aliases" ,
}
local action_pending = tabletohash(action_sequence, false)
Expand Down Expand Up @@ -1396,6 +1396,21 @@ function actions.diagnose (job)
return diagnose (job)
end

function actions.aliases (job)
--- Help XeTeX find fonts
local name_index = fonts.names.data() or fonts.names.load()
local mappings = name_index.mappings
local fontnames = name_index.fontnames.texmf
local formats = { 'ttf', 'otf', }
for _, format in ipairs(formats) do
for name, mapping in pairs(fontnames[format]) do
mapping = mappings[mapping]
print(string.format('%s %s', mapping.basename, name))
end
end
return true
end

--- stuff to be carried out prior to exit

local finalizers = { }
Expand Down Expand Up @@ -1434,6 +1449,7 @@ local function process_cmdline ( ) -- unit -> jobspec
}
local long_options = {
aliases = 0,
["bisect"] = 1,
cache = 1,
conf = 1,
Expand Down Expand Up @@ -1587,6 +1603,8 @@ local function process_cmdline ( ) -- unit -> jobspec
action_pending["dumpconf"] = true
elseif v == "print-conf" then
result.print_config = true
elseif v == "aliases" then
action_pending["aliases"] = true
end
end
Expand Down

0 comments on commit e118e07

Please sign in to comment.