summaryrefslogtreecommitdiff
path: root/luaotfload.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'luaotfload.dtx')
-rw-r--r--luaotfload.dtx36
1 files changed, 36 insertions, 0 deletions
diff --git a/luaotfload.dtx b/luaotfload.dtx
index d38ccd0..3e0bd36 100644
--- a/luaotfload.dtx
+++ b/luaotfload.dtx
@@ -597,6 +597,42 @@ fonts.mode = "node"
caches.compilemethod = "both"
% \end{macrocode}
%
+% Now overriding the \context's definition of |tlig| and |trep| features.
+%
+% \begin{macrocode}
+local tlig = {
+ [0x2013] = {0x002D, 0x002D}, -- endash
+ [0x2014] = {0x002D, 0x002D, 0x002D}, -- emdash
+ [0x201C] = {0x2018, 0x2018}, -- quotedblleft
+ [0x201D] = {0x2019, 0x2019}, -- quotedblright
+ [0x201C] = {0x0060, 0x0060}, -- quotedblleft
+ [0x201D] = {0x0027, 0x0027}, -- quotedblright
+ [0x201E] = {0x002C, 0x002C}, -- quotedblbase
+}
+
+local trep = {
+ [0x0027] = 0x2019, -- quoteleft
+ [0x0060] = 0x2018, -- quoteright
+}
+
+local trep_specification = {
+ type = "substitution",
+ features = everywhere,
+ data = trep,
+ flags = noflags,
+}
+
+local tlig_specification = {
+ type = "ligature",
+ features = everywhere,
+ data = tlig,
+ flags = noflags,
+}
+
+fonts.handlers.otf.addfeature("tlig", tlig_specification)
+fonts.handlers.otf.addfeature("trep", trep_specification)
+% \end{macrocode}
+%
% we provide a callback for patching fonts on the fly, to be used by other
% packages.
%