summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua58
1 files changed, 37 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua
index 40883799c54..4b2f20619ff 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-features.lua
@@ -1,5 +1,5 @@
if not modules then modules = { } end modules ["features"] = {
- version = "2.3a",
+ version = "2.4",
comment = "companion to luaotfload.lua",
author = "Hans Hagen, Khaled Hosny, Elie Roux, Philipp Gesang",
copyright = "PRAGMA ADE / ConTeXt Development Team",
@@ -14,11 +14,25 @@ local lpegmatch = lpeg.match
---[[ begin included font-ltx.lua ]]
--- this appears to be based in part on luatex-fonts-def.lua
-local fonts = fonts
+local fonts = fonts
+local definers = fonts.definers
+local handlers = fonts.handlers
+
+local as_script, normalize
+
+if handlers then
+ normalize = handlers.otf.features.normalize
+else
+ normalize = function () end
+ as_script = true
+end
+
--HH A bit of tuning for definitions.
-fonts.constructors.namemode = "specification" -- somehow latex needs this (changed name!) => will change into an overload
+if fonts.constructors then
+ fonts.constructors.namemode = "specification" -- somehow latex needs this (changed name!) => will change into an overload
+end
--[[HH--
tricky: we sort of bypass the parser and directly feed all into
@@ -39,9 +53,6 @@ local stringformat = string.format
local stringis_empty = string.is_empty
local mathceil = math.ceil
---- TODO an option to dump the default features for a script would make
---- a nice addition to luaotfload-tool
-
local defaults = {
dflt = {
"ccmp", "locl", "rlig", "liga", "clig",
@@ -1086,9 +1097,9 @@ local select_lookup = function (request)
end
local supported = {
- b = "bold",
- i = "italic",
- bi = "bolditalic",
+ b = "b",
+ i = "i",
+ bi = "bi",
aat = false,
icu = false,
gr = false,
@@ -1185,20 +1196,21 @@ local handle_request = function (specification)
--- The next line sets the “rand” feature to “random”; I haven’t
--- investigated it any further (luatex-fonts-ext), so it will
--- just stay here.
- specification.features.normal
- = fonts.handlers.otf.features.normalize(request.features)
+ specification.features.normal = normalize (request.features)
return specification
end
-local compare_requests = function (spec)
- local old = old_behavior(spec)
- local new = handle_request(spec)
- return new
+if as_script == true then --- skip the remainder of the file
+ fonts.names.handle_request = handle_request
+ report ("log", 5, "load",
+ "Exiting early from luaotfload-features.lua.")
+ return
+else
+ local registersplit = definers.registersplit
+ registersplit (":", handle_request, "cryptic")
+ registersplit ("", handle_request, "more cryptic") -- catches \font\text=[names]
end
-fonts.definers.registersplit(":", handle_request, "cryptic")
-fonts.definers.registersplit("", handle_request, "more cryptic") -- catches \font\text=[names]
-
---[[ end included font-ltx.lua ]]
--[[doc--
@@ -1411,9 +1423,13 @@ local tlig = {
[0x2014] = {0x002D, 0x002D, 0x002D}, -- emdash
[0x201C] = {0x2018, 0x2018}, -- quotedblleft
[0x201D] = {0x2019, 0x2019}, -- quotedblright
- [0x201E] = {0x002C, 0x002C}, -- quotedblbase
[0x00A1] = {0x0021, 0x2018}, -- exclamdown
[0x00BF] = {0x003F, 0x2018}, -- questiondown
+ --- next three originate in T1 encoding; Xetex applies
+ --- them too
+ [0x201E] = {0x002C, 0x002C}, -- quotedblbase
+ [0x00AB] = {0x003C, 0x003C}, -- LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+ [0x00BB] = {0x003E, 0x003E}, -- RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
},
flags = { },
},
@@ -1430,8 +1446,8 @@ local tlig = {
},
}
-otf.addfeature("tlig", tlig)
-otf.addfeature("trep", { }) -- empty, all in tlig now
+otf.addfeature ("tlig", tlig)
+otf.addfeature ("trep", { })
local anum_arabic = { --- these are the same as in font-otc
[0x0030] = 0x0660,