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

Marcel Fabian Krüger tex at 2krueger.de
Tue Sep 17 13:55:03 CEST 2019


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

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

commit 013fff013719c83760faec906e1371773b2e03a3
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.


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

013fff013719c83760faec906e1371773b2e03a3
 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 0932ed0..f1280aa 100644
--- a/src/harf/harf-luaotfload.lua
+++ b/src/harf/harf-luaotfload.lua
@@ -27,23 +27,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,
@@ -77,16 +68,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