[latex3-commits] [git/LaTeX3-latex3-luaotfload] xetex: Allow converting database into aliases for XeTeX (e118e07)

Marcel Fabian Krüger tex at 2krueger.de
Sat May 8 16:43:02 CEST 2021


Repository : https://github.com/latex3/luaotfload
On branch  : xetex
Link       : https://github.com/latex3/luaotfload/commit/e118e07e3f3bfe360d969b317b31d04753997dcd

>---------------------------------------------------------------

commit e118e07e3f3bfe360d969b317b31d04753997dcd
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Sat May 8 16:43:02 2021 +0200

    Allow converting database into aliases for XeTeX


>---------------------------------------------------------------

e118e07e3f3bfe360d969b317b31d04753997dcd
 src/luaotfload-tool.lua | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua
old mode 100644
new mode 100755
index df05094..c18c200
--- a/src/luaotfload-tool.lua
+++ b/src/luaotfload-tool.lua
@@ -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)
@@ -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 = { }
@@ -1434,6 +1449,7 @@ local function process_cmdline ( ) -- unit -> jobspec
     }
 
     local long_options = {
+        aliases            = 0,
         ["bisect"]         = 1,
         cache              = 1,
         conf               = 1,
@@ -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
 





More information about the latex3-commits mailing list.