[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Simulate different pathname for harf fonts (0e84d3b)

Marcel Fabian Krüger tex at 2krueger.de
Thu Nov 14 18:39:21 CET 2019


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/0e84d3bb8d88ea5726329bdfcc47de42a1ab71d1

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

commit 0e84d3bb8d88ea5726329bdfcc47de42a1ab71d1
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Fri Nov 1 14:59:43 2019 +0100

    Simulate different pathname for harf fonts
    
    Fixes #107, breaks ttc fonts for harf mode in engines older than 1.11.2.


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

0e84d3bb8d88ea5726329bdfcc47de42a1ab71d1
 src/luaotfload-harf-define.lua | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/luaotfload-harf-define.lua b/src/luaotfload-harf-define.lua
index ad02cdb..aa2e544 100644
--- a/src/luaotfload-harf-define.lua
+++ b/src/luaotfload-harf-define.lua
@@ -316,7 +316,7 @@ local function scalefont(data, spec)
 
   local tfmdata = {
     name = spec.specification,
-    filename = spec.resolved,
+    filename = 'harfloaded:' .. spec.resolved,
     subfont = spec.sub or 1,
     designsize = size,
     psname = sanitize(data.psname),
@@ -404,3 +404,11 @@ fonts.readers.harf = function(spec)
   end
   return scalefont(loadfont(spec), spec)
 end
+
+luatexbase.add_to_callback('find_opentype_file', function(name)
+  return name:gsub('^harfloaded:', '')
+end, 'luaotfload.harf.strip_prefix')
+
+luatexbase.add_to_callback('find_truetype_file', function(name)
+  return name:gsub('^harfloaded:', '')
+end, 'luaotfload.harf.strip_prefix')





More information about the latex3-commits mailing list