[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: (node) Replace ẞ by SS when the former is missing (1fd455b)

Marcel Fabian Krüger tex at 2krueger.de
Fri Feb 14 00:16:45 CET 2020


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/1fd455b6a9268c0d55563d851fd6273a64d0fdce

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

commit 1fd455b6a9268c0d55563d851fd6273a64d0fdce
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Fri Feb 14 00:01:15 2020 +0100

    (node) Replace ẞ by SS when the former is missing


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

1fd455b6a9268c0d55563d851fd6273a64d0fdce
 src/luaotfload-main.lua |  1 +
 src/luaotfload-szss.lua | 59 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua
index 57f0dc5..8866009 100644
--- a/src/luaotfload-main.lua
+++ b/src/luaotfload-main.lua
@@ -327,6 +327,7 @@ luaotfload.main = function ()
     loadmodule "letterspace"  --- extra character kerning
     loadmodule "embolden"     --- fake bold
     loadmodule "notdef"       --- missing glyph handling
+    loadmodule "szss"       --- missing glyph handling
     if harfstatus then
         loadmodule "harf-define"
         loadmodule "harf-plug"
diff --git a/src/luaotfload-szss.lua b/src/luaotfload-szss.lua
new file mode 100644
index 0000000..12bfc8a
--- /dev/null
+++ b/src/luaotfload-szss.lua
@@ -0,0 +1,59 @@
+-----------------------------------------------------------------------
+--         FILE:  luaotfload-szss.lua
+--  DESCRIPTION:  part of luaotfload / szss
+-----------------------------------------------------------------------
+
+local ProvidesLuaModule = { 
+    name          = "luaotfload-szss",
+    version       = "3.1301-dev",       --TAGVERSION
+    date          = "2020-02-02", --TAGDATE
+    description   = "luaotfload submodule / color",
+    license       = "GPL v2.0",
+    author        = "Marcel Krüger"
+}
+
+if luatexbase and luatexbase.provides_module then
+  luatexbase.provides_module (ProvidesLuaModule)
+end  
+
+local insert             = table.insert
+local otfregister        = fonts.constructors.features.otf.register
+
+local sequence = {
+  features = {szss = {["*"] = {["*"] = true}}},
+  flags = {false, false, false, false},
+  name = "szss",
+  order = {"szss"},
+  nofsteps = 1,
+  steps = {{
+    coverage = {
+      [0x1E9E] = {0x53, 0x53},
+    },
+    index = 1,
+  }},
+  type = "gsub_multiple",
+}
+local function szssinitializer(tfmdata, value, features)
+  if value == 'auto' then
+    value = not tfmdata.characters[0x1E9E]
+    features.szss = value
+    if not value then return end -- Not strictly necessary
+  end
+  local resources = tfmdata.resources
+  local sequences = resources and resources.sequences
+  if sequences then
+    -- Add the substitution at the very beginning to properly
+    -- integrate the 'SS' in shaping decisions
+    insert(sequences, 1, sequence)
+  end
+end
+otfregister {
+  name = 'szss',
+  description = 'Replace capital ß with SS',
+  default = 'auto',
+  initializers = {
+    node = szssinitializer,
+  },
+}
+
+--- vim:sw=2:ts=2:expandtab:tw=71





More information about the latex3-commits mailing list.