[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Fix handling of missing fonts (6b20296)

Marcel Fabian Krüger tex at 2krueger.de
Wed Jan 22 03:50:47 CET 2020


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/6b20296d10aa1d21ed6e5a6885ae10dcb7dd9305

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

commit 6b20296d10aa1d21ed6e5a6885ae10dcb7dd9305
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Wed Jan 22 02:45:56 2020 +0100

    Fix handling of missing fonts


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

6b20296d10aa1d21ed6e5a6885ae10dcb7dd9305
 src/luaotfload-loaders.lua | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/src/luaotfload-loaders.lua b/src/luaotfload-loaders.lua
index 341e5be..25f9826 100644
--- a/src/luaotfload-loaders.lua
+++ b/src/luaotfload-loaders.lua
@@ -124,15 +124,12 @@ do
   local register = fonts.definers.register
   local function read(specification, size, id)
     local tfmdata = ctx_read(specification, size, id)
-    if tonumber(tfmdata) then
+    if not tfmdata or id or tonumber(tfmdata) then
       return tfmdata
     end
-    if not id then
-      id = font.define(tfmdata)
-      register(tfmdata, id)
-      return id
-    end
-    return tfmdata
+    id = font.define(tfmdata)
+    register(tfmdata, id)
+    return id
   end
 
   local patch = function (specification, size, id)
@@ -146,15 +143,12 @@ do
     else
       luatexbase.call_callback ("luaotfload.patch_font_unsafe", fontdata, specification, id)
     end
-    if tonumber(fontdata) then
+    if not fontdata or id or tonumber(fontdata) then
       return fontdata
     end
-    if not id then
-      id = font.define(fontdata)
-      register(fontdata, id)
-      return id
-    end
-    return fontdata
+    id = font.define(fontdata)
+    register(fontdata, id)
+    return id
   end
 
   local mk_info = function (name)





More information about the latex3-commits mailing list