[latex3-commits] [git/LaTeX3-latex3-luaotfload] harf-dev: Revert "Force harf mode when no mode is explicitly set" (04070e7)

Marcel Fabian Krüger tex at 2krueger.de
Tue Sep 17 16:14:11 CEST 2019


Repository : https://github.com/latex3/luaotfload
On branch  : harf-dev
Link       : https://github.com/latex3/luaotfload/commit/04070e7142f851611915691194a9d3db50f6963c

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

commit 04070e7142f851611915691194a9d3db50f6963c
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Tue Sep 17 01:45:05 2019 +0200

    Revert "Force harf mode when no mode is explicitly set"
    
    This reverts commit 3d052a1e1857424c3124b18d426ee325d1935b6d.


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

04070e7142f851611915691194a9d3db50f6963c
 src/harf/harf-luaotfload.lua | 27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/src/harf/harf-luaotfload.lua b/src/harf/harf-luaotfload.lua
index 8a37327..d3d52b8 100644
--- a/src/harf/harf-luaotfload.lua
+++ b/src/harf/harf-luaotfload.lua
@@ -22,23 +22,14 @@ if callback_warning then
   callback_warning = false
 end
 
-local readers = {
-  opentype = fonts.readers.opentype,
-  otf = fonts.readers.otf,
-  ttf = fonts.readers.ttf,
-  ttc = fonts.readers.ttc,
-}
-
-local function harf_reader(spec)
+-- Register a reader for `harf` mode (`mode=harf` font option) so that we only
+-- load fonts when explicitly requested. Fonts we load will be shaped by the
+-- callbacks we register below.
+fonts.readers.harf = function(spec)
   local features = {}
   local options = {}
   local rawfeatures = spec.features and spec.features.raw or {}
 
-  local mode = rawfeatures.mode
-  if mode and mode ~= "harf" then
-    return readers[spec.forced](spec)
-  end
-
   -- Rewrite luaotfload specification to look like what we expect.
   local specification = {
     features = features,
@@ -72,16 +63,6 @@ local function harf_reader(spec)
   return define_font(specification)
 end
 
--- Register font readers. We override the default ones to always use HarfBuzz
--- if no mode is explicitly set or when `mode=harf` is used, otherwise we
--- fallback to the old readers. Fonts we load will be shaped by the callbacks
--- we register below.
-fonts.readers.harf = harf_reader
-fonts.readers.opentype = harf_reader
-fonts.readers.otf = harf_reader
-fonts.readers.ttf = harf_reader
-fonts.readers.ttc = harf_reader
-
 local GSUBtag = harf.Tag.new("GSUB")
 local GPOStag = harf.Tag.new("GPOS")
 local dflttag = harf.Tag.new("dflt")





More information about the latex3-commits mailing list