diff options
author | Hans Hagen <pragma@wxs.nl> | 2014-07-06 22:50:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2014-07-06 22:50:00 +0200 |
commit | 73b0f4f97a684af38d4aa3bfd4829939ad47c7c7 (patch) | |
tree | ac5b5ddb99c69592da73cb5618af6c3832cd99b7 /tex/context/base/char-fio.lua | |
parent | db237f90e36d8862262f16f579eb98c1948faa03 (diff) | |
download | context-73b0f4f97a684af38d4aa3bfd4829939ad47c7c7.tar.gz |
beta 2014.07.06 22:50
Diffstat (limited to 'tex/context/base/char-fio.lua')
-rw-r--r-- | tex/context/base/char-fio.lua | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tex/context/base/char-fio.lua b/tex/context/base/char-fio.lua new file mode 100644 index 000000000..766ea7123 --- /dev/null +++ b/tex/context/base/char-fio.lua @@ -0,0 +1,56 @@ +if not modules then modules = { } end modules ['char-fio'] = { + version = 1.001, + comment = "companion to char-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- -- + +local sequencers = utilities.sequencers +local appendaction = sequencers.appendaction +local enableaction = sequencers.enableaction +local disableaction = sequencers.disableaction + +local utffilters = characters.filters.utf + +local textfileactions = resolvers.openers.helpers.textfileactions +local textlineactions = resolvers.openers.helpers.textlineactions + +appendaction (textfileactions,"system","characters.filters.utf.reorder") +disableaction(textfileactions, "characters.filters.utf.reorder") + +appendaction (textlineactions,"system","characters.filters.utf.reorder") +disableaction(textlineactions, "characters.filters.utf.reorder") + +appendaction (textfileactions,"system","characters.filters.utf.collapse") +disableaction(textfileactions, "characters.filters.utf.collapse") + +appendaction (textfileactions,"system","characters.filters.utf.decompose") +disableaction(textfileactions, "characters.filters.utf.decompose") + +function characters.filters.utf.enable() + enableaction(textfileactions,"characters.filters.utf.reorder") + enableaction(textfileactions,"characters.filters.utf.collapse") + enableaction(textfileactions,"characters.filters.utf.decompose") +end + +local function configure(what,v) + if not v then + disableaction(textfileactions,what) + disableaction(textlineactions,what) + elseif v == "line" then + disableaction(textfileactions,what) + enableaction (textlineactions,what) + else -- true or text + enableaction (textfileactions,what) + disableaction(textlineactions,what) + end +end + +directives.register("filters.utf.reorder", function(v) configure("characters.filters.utf.reorder", v) end) +directives.register("filters.utf.collapse", function(v) configure("characters.filters.utf.collapse", v) end) +directives.register("filters.utf.decompose", function(v) configure("characters.filters.utf.decompose",v) end) + +utffilters.setskippable { "mkiv", "mkvi", "mkix", "mkxi" } |