[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Avoiding finding file with wrong format during kpse search (9cf978f)

Marcel Fabian Krüger tex at 2krueger.de
Sun May 1 22:23:28 CEST 2022


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/9cf978fdb339f41d95d6a556eed144f8facdc08e

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

commit 9cf978fdb339f41d95d6a556eed144f8facdc08e
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Sun May 1 22:23:28 2022 +0200

    Avoiding finding file with wrong format during kpse search


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

9cf978fdb339f41d95d6a556eed144f8facdc08e
 src/luaotfload-resolvers.lua | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/luaotfload-resolvers.lua b/src/luaotfload-resolvers.lua
index b8e4854..6c07a83 100644
--- a/src/luaotfload-resolvers.lua
+++ b/src/luaotfload-resolvers.lua
@@ -148,6 +148,10 @@ local function resolve_tex_format (specification)
     local name = specification.name
     for i=1, #tex_formats do
         local format = tex_formats [i]
+        local name = name
+        if name:sub(-#format-1) ~= '.' .. format then -- Add an explicit extension to avoid finding local fonts in other formats
+            name = name .. '.' .. format
+        end
         local resolved = resolvers_findfile(name, format)
         if resolved then
             return resolved, format





More information about the latex3-commits mailing list.