summaryrefslogtreecommitdiff
path: root/luaotfload.dtx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2011-12-19 21:36:31 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2011-12-19 21:36:40 +0200
commit86fa1ee21d5cd007e21a221f0c8a328b38122806 (patch)
tree035abde6f40ff76b994c6a192c7f26bdf9137df8 /luaotfload.dtx
parent0e0330b91fee89870b543c456f8119486add4d08 (diff)
downloadluaotfload-86fa1ee21d5cd007e21a221f0c8a328b38122806.tar.gz
Re-enable tlig and trep features
Single quotes are not ligated into double quotes though, no idea yet.
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.
%