From 86fa1ee21d5cd007e21a221f0c8a328b38122806 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 19 Dec 2011 21:36:31 +0200 Subject: Re-enable tlig and trep features Single quotes are not ligated into double quotes though, no idea yet. --- luaotfload.dtx | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) 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. % -- cgit v1.2.3