summaryrefslogtreecommitdiff
path: root/tex/context/base/typo-rep.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2010-05-24 13:05:00 +0200
committerHans Hagen <pragma@wxs.nl>2010-05-24 13:05:00 +0200
commite08195a7149edffddb4b69b480676fad336a7613 (patch)
treefd8b871b50b1a1404610e2dc5d118bfdf4cc1a68 /tex/context/base/typo-rep.mkiv
parent882238ac1ea6d9563ea4e1add879f82ee8e6d9d0 (diff)
downloadcontext-e08195a7149edffddb4b69b480676fad336a7613.tar.gz
stable 2010.05.24 13:05
Diffstat (limited to 'tex/context/base/typo-rep.mkiv')
-rw-r--r--tex/context/base/typo-rep.mkiv53
1 files changed, 53 insertions, 0 deletions
diff --git a/tex/context/base/typo-rep.mkiv b/tex/context/base/typo-rep.mkiv
new file mode 100644
index 000000000..2f1d8b4cb
--- /dev/null
+++ b/tex/context/base/typo-rep.mkiv
@@ -0,0 +1,53 @@
+%D \module
+%D [ file=typo-rep,
+%D version=2010.05.23,
+%D title=\CONTEXT\ Typesetting Macros,
+%D subtitle=Stripping,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=\PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Typesetting Macros / Stripping}
+
+% experimental stripping
+
+%D For a while we had stripping built into the analyzer. Khaled
+%D suggested to generalize this so I changed the code into a
+%D manipulator there.
+%D
+%D \starttyping
+%D \definefontfeature[default][default][mode=node,formatters=strip]
+%D \stoptyping
+%D
+%D However, in \MKIV\ it makes more sense to also provide it as a more
+%D general feature. Here we implement this as experiment. I might
+%D cook up a few more variants in both variants.
+%D
+%D \starttyping
+%D \setcharacterstripping[1]
+%D \stoptyping
+
+\unprotect
+
+\registerctxluafile{typo-rep}{1.001}
+
+\definesystemattribute[stripping] \chardef\strippingattribute \dogetattributeid{stripping}
+
+\def\setcharacterstripping
+ {\ctxlua{nodes.stripping.enable()}%
+ \gdef\setcharacterstripping[##1]{\attribute\strippingattribute##1\relax}%
+ \setcharacterstripping}
+
+\def\resetcharacterstripping
+ {\attribute\strippingattribute\attributeunsetvalue}
+
+% maybe .. this might disappear, but is handy for testing
+
+\def\forcecharacterstripping % secret command
+ {\ctxlua{fonts.otf.features.register("formatters",true)}}
+
+\protect \endinput