diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2012-08-09 20:41:38 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2012-08-09 20:41:38 +0200 |
commit | 9291e1983240e72d93815a096963dc28a7acd770 (patch) | |
tree | a0dbea1299d5c92c6c7571a161c3b14956500626 /luaotfload.dtx | |
parent | 77f277d8de1ecf1a5f9260fa8eff1bc050687f71 (diff) | |
download | luaotfload-9291e1983240e72d93815a096963dc28a7acd770.tar.gz |
Simplify the whole thing
Diffstat (limited to 'luaotfload.dtx')
-rw-r--r-- | luaotfload.dtx | 54 |
1 files changed, 24 insertions, 30 deletions
diff --git a/luaotfload.dtx b/luaotfload.dtx index 9bf0ac9..3538075 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -596,58 +596,52 @@ fonts.mode = "node" caches.compilemethod = "both" % \end{macrocode} % -% Now overriding the \context's definition of |tlig| and |trep| features. +% Now overriding the \context's definition of |tlig| and |trep| features, +% using code points instead of glyph names to make it font independent. % % \begin{macrocode} local everywhere = { ["*"] = { ["*"] = true } } -local noflags = { } local tlig = { - [0x2013] = {0x002D, 0x002D}, -- endash - [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 -} - -local tlig2 = { - [0x201C] = {0x0060, 0x0060}, -- quotedblleft - [0x201D] = {0x0027, 0x0027}, -- quotedblright - [0x00A1] = {0x0021, 0x0060}, -- exclamdown - [0x00BF] = {0x003F, 0x0060}, -- questiondown -} - -local trep = { - [0x0022] = 0x201D, -- quotedblright - [0x0027] = 0x2019, -- quoteleft - [0x0060] = 0x2018, -- quoteright -} - -local tlig_specification = { { type = "substitution", features = everywhere, - data = trep, + data = { + [0x0022] = 0x201D, -- quotedblright + [0x0027] = 0x2019, -- quoteleft + [0x0060] = 0x2018, -- quoteright + }, flags = { }, }, { type = "ligature", features = everywhere, - data = tlig, + data = { + [0x2013] = {0x002D, 0x002D}, -- endash + [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 + }, flags = { }, }, { type = "ligature", features = everywhere, - data = tlig2, + data = { + [0x201C] = {0x0060, 0x0060}, -- quotedblleft + [0x201D] = {0x0027, 0x0027}, -- quotedblright + [0x00A1] = {0x0021, 0x0060}, -- exclamdown + [0x00BF] = {0x003F, 0x0060}, -- questiondown + }, flags = { }, }, } -fonts.handlers.otf.addfeature("tlig", tlig_specification) -fonts.handlers.otf.addfeature("trep", { }) +fonts.handlers.otf.addfeature("tlig", tlig) +fonts.handlers.otf.addfeature("trep", { }) -- empty, all in tlig now % \end{macrocode} % % And overriding the \context's definition of |anum|. |